| | |
A Default size for a blank JList?
![]() |
•
•
Join Date: Dec 2004
Posts: 27
Reputation:
Solved Threads: 0
Hello, I'm currently creating a PlayList for a media application I am working on. I'm using a JList as the GUI object for the PlayList and a DefaultListModel as the storage area to be held in the PlayList. I was hoping that if I was to pass a DefaultListModel object containing no information I could create a JList that had, lets say, 5 rows visible how that doesn't seem to be the case. Overall I'm hoping that I can have the playlist (JList) stay the same size whether their is data in the DefaultListModel or if it is completely empty (like a new playlist. Basically the playlist would sort of work like Winamp's. Below is some of the code I'm using:
Thanks in advance for the help
Java Syntax (Toggle Plain Text)
playListPanel=new JPanel(); playListPanel.setBorder(new TitledBorder("PlayList")); playListData=new DefaultListModel(); playListDisplay=new JList(); playListDisplay.setModel(playListData); playListDisplay.setFixedCellWidth(300); playListDisplay.setVisibleRowCount(5); playListDisplay.setDragEnabled(true); playListData.addElement(""); //playListDisplay.setListData(playListData); scrollPane = new JScrollPane(playListDisplay, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); playListPanel.add(scrollPane);
Thanks in advance for the help
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
•
•
•
•
Overall I'm hoping that I can have the playlist (JList) stay the same size whether their is data in the DefaultListModel or if it is completely empty
![]() |
Similar Threads
- Problems with second hard drive (Storage)
- How do I print forms with more than the default size of a form ? (Visual Basic 4 / 5 / 6)
- wrong output (C++)
- compilation errors (C++)
- Change the Start Menu Style (Windows tips 'n' tweaks)
- about:blank on yahoo.com.. please help (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: Need the services of a Java programmer
- Next Thread: first project in netbeans
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working





