Categories

JAVA DATEBASE
Technology Network Community
Oracle Database
Fusion Middleware
Development Tools
Java
Desktop
Server & Storage Systems
Enterprise Management
Berkeley DB Family
Cloud Computing
Big Data
Business Intelligence
Architecture
Migration and Modernization
E-Business Suite
Siebel
PeopleSoft Enterprise
JD Edwards World
Industries
JD Edwards EnterpriseOne
User Productivity Kit Pro (UPK) and Tutor
Governance, Risk & Compliance (GRC)
Master Data Management (MDM)
Oracle CRM On Demand
On Demand: SaaS and Managed Applications
AutoVue Enterprise Visualization
Primavera
ATG
Agile PLM
Endeca Experience Management
Fusion Applications
Archived Forums

 



Tags

New To Java


JList ?


hi, guys  I help help about the JList  with String variables how can u add 2 or 3 String Variable to  the Same JList without using an array? ex String a=".."; String b= "..."; String c= "....";      JList list = new JList(); ....

A loop?  I don't really understand what you're asking.

How about setListData(something) where something is an array of objects (can't get around that) or a vector?

A JList offers a view of the data, and lets you select items etc.  To add data, you add them to the JLists's model.  From the API: "A ListModel can be supplied directly to a JList by way of a constructor or the setModel method. The contents need not be static - the number of items, and the values of items can change over time. ... "Simple, dynamic-content, JList applications can use the DefaultListModel class to maintain list elements."  For example:import javax.swing.DefaultListModel; import javax.swing.JFrame; import javax.swing.JList;   public class JListEg {       public static void main(String[] args) {         DefaultListModel model = new DefaultListModel();         JList list = new JList(model); 		         model.addElement(".");         model.addElement("..");         model.addElement("...");           JFrame frame = new JFrame();         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         frame.add(list);         frame.pack();         frame.setVisible(true);     } } 

Thank , guys


Related Links

which one to choose
Working out a percentage in my method?
Instance Variables
Troubles connecting SQL Server
check box
identity increment .........
how to correct this error???
Create exe from a java prog that uses Jess rule engine
Printing *'s
I am new to Java
I am new to java
array to binary tree conversion
Help for Arrays
Problem with mouselistener on JTable
problem running "javac"
how can i convert object to array list