Java Utililty Methods JList Create

List of utility methods to do JList Create

Description

The list of methods to do JList Create are organized into topic(s).

Method

JScrollPanecreateJScrollPane(JList list)
Creates a new JScrollPane object with the given properties.
JScrollPane jScrollPane = new JScrollPane();
jScrollPane.setViewportView(list);
jScrollPane.setAutoscrolls(true);
return jScrollPane;
StringcreateList(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 += "\"";
...
JScrollPanecreateListPane(JList list, String text)
create List Pane
JScrollPane pane = new JScrollPane(list);
pane.setBorder(
        BorderFactory.createCompoundBorder(createBorder(text), BorderFactory.createLoweredBevelBorder()));
return pane;