List of utility methods to do JList Create
JScrollPane | createJScrollPane(JList list) Creates a new JScrollPane object with the given properties.
JScrollPane jScrollPane = new JScrollPane(); jScrollPane.setViewportView(list); jScrollPane.setAutoscrolls(true); return jScrollPane; |
String | createList(JList aListComponent, boolean createQuotes) Creates a String representation of the contents of a JList component Example of output with createQuotes : ["123","456","789"] Example of output with !createQuotes: [123,456,789] Returns '[]' when no items were detected in the JList. String aList = "["; if (aListComponent.getModel().getSize() > 0) { if (createQuotes) { aList += "\""; aList += (String) aListComponent.getModel().getElementAt(0); if (createQuotes) { aList += "\""; ... |
JScrollPane | createListPane(JList list, String text) create List Pane JScrollPane pane = new JScrollPane(list); pane.setBorder( BorderFactory.createCompoundBorder(createBorder(text), BorderFactory.createLoweredBevelBorder())); return pane; |