java - Selecting An Entire Jlist in Swing -


I have looked at the answer SO and elsewhere but can not find the answer whether to select the whole prison instead of a particular item possible? For example, if a user clicks on a zest white area, then I can call a method that will keep the name of that jellist in the hashmap or call another method to replace the entire list. Hope the code gives you an idea that any kind of information will be useful. Thank you.

Final Jellist List_1 = New Zelist (List 1); List_1.addFocusListener (New Focus Adapter) {@Override Public Zero Focus (Focus Event arg0) {// Completed list disappears when selected list_1.SetView (wrong);}}); Gridbag Consultants gbc_list_1 = New Gridbag Consultants (); Gbc_list_1.gridheight = 3; Gbc_list_1.insets = New Inputs (0, 0, 5, 5); Gbc_list_1.fill = GridBagConstraints.BOTH; Gbc_list_1.gridx = 5; Gbc_list_1.gridy = 0; Panel.add (list_1, gbc_list_1);

Is it possible to select a whole gel Specific items?

Yes, unless you are allowed to do this, for example, if a user clicks on the white area of ​​the prison ...

Better than this, select the "All Types" button and work with ListSelectionModel so that you do not need to mess with the focus subsystem. For example:

  last JList list = new JList (); ... Select Action AllAction = New AbstractAction ("Select All") {@Override Public Zero Functionality (ActionEvent E) {list.getSelectionModel () SetSelectionInterval (0, list.getModel (). GetSize () - 1); }}; ... Select the pocket buttonAlbutton = new pocket (SelectionAction only);  

... I can call a method that will keep the name of that jellist in a hashmap or call any other method to replace the entire list Will do

I do not have any idea what you mean? Em> change the list completely or why you want to do this a hashmap , so I am not able to assist you. For better help, please include


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -