java - How to set the ListModel of a JList in Netbeans? -


I have designed a swing GUI with the help of Netbeans IDE and there is a JLIT in this GUI.

Bydefault, it uses the Abellestrist MODEL to pass it as a logic in the JLIT constructor to make JLIST.

I want to specify the DeliList model to pass in NetBinx to pass in the JLIS model as passage so that I can retrieve it later to change the list model.

How can I do this?

You have two ways to do this:

1) In your code Manually call call.setModel () is also called after initComponents (). 2) Do it through Netbans - Right click on the list, go to "Customize Code" The first code section is the constructor call of the list. Change the dropdown from "custom code" to "custom creations" and simply enter your lists mode in the constructor call. You can do this by setting a new

  javax.swing.JList (new DefaultListModel ())  

or immediately by calling your listmodel before calling Can code initComponents () and then

  javax.swing.JList (defaultModel);  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -