I have something like a textfieldinput with a more complex consisting renderer many components to a catalog (more accurate (some Use buttons to arrange in a panel). But when I try to use a button in a list it seems to ignore clicks. Minimal Example Edit : As suggested combined minimum example An updated question since the original problem was solved during the creation of at least the example Not a single renderer is enough; You also need to have that
import DefaultListCellRenderer import JFrame def printer () javax.swin import JPanel javax.swing the javax.swing import JList from Javaxkswing The g import JLabel in javax.swing import JButton javax.swing import javax.swing from DefaultListSelectionModel: print "button is pressed" category Do (DefaultListCellRenderer): def getListCellRendererComponent (self, Thelist, value, index, selected, hasFocus): renderer = DefaultListCellRendererkgetListCellRendererComponent (self, Thelist, value, index, selected, HasFocus) if selected: pan = JPanel () Pan.ad (Jeelabl ( 'beer')) pan add (Jebtn ( "get a 'Kriyapryukt = printer) ) Again nderer = Return Return Renderer Panel = JFrame ('Example', Size = (200,200)) Configuration = JList ([1,2,3,4], please = Do (), selectionMode = DefaultListSelectionModel.SINGLE_SELECTION) to panel.add (configuration) Panel.visible = true
JList is not part of the API Alternatively, a
JTable using an editor is an example of a Of course, you can also use it with a
radio button containing StatusPanel .
after "div class =" text "itemprop =" text ">
Comments
Post a Comment