Member Avatar

Guys, Im wondering, If I have another class with a jpanel in it... and I add this to the jPanel, this should work correct? jpanel.add(new DoughOverviewList()); jpanel.repaint(); for some reason its not showing in my jpanel, /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package doughtracker; import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; import javax.swing.JList; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; import javax.swing.border.Border; import javax.swing.event.ListSelectionEvent; /** * * @author Acer */ public class DoughOverviewList extends JList { …

Member Avatar
+0 forum 4
Member Avatar

Hi Guys, How to write the contents of JList into a text file. i have a JList and i want to add the list elements to a text file. How to do this?

Member Avatar
+0 forum 1
Member Avatar

hi, I want to display only the user id and the name in jList and when the user select something from the jList detailes of that person will be display in a lable can you explain to me how to do it.. I've managed to display all the deatiles of the person i the JList , but I only want the id and name to display

Member Avatar
+0 forum 7
Member Avatar

I have been tryin to get this to work for the past week if not two >:( with no joy. Worst of all its such a trivial problem. The program asks you to choose a town name from a combo box when you choose the location you shoud be brought to a brand new Jframe with a populated Jtable. Now everything does what its meant to do except the jframe window which opens as the border of the window and the minmise,maximise and close buttons. You can view the database by expanding the jframe window from the bottom right corner(Click …

Member Avatar
+0 forum 7
Member Avatar

Hello, I am having some trouble writing this java GUI. First in the win1, i cannot get the start and exit button to the bottom of the page along with the jlabel into the center. Next for win2 i cannot resize the "go here" button at the bottom of the page. also from win2 i cant get he add button to update the contents of the jlist, ie click add, write in servers name, and have it appear on the list. the code i have comment out in win2 is what i thought i needed, but I cannot get it …

+0 forum 0
Member Avatar

Hi forum, I just need a little help on one thing, how can I import this text document and make it usable in a JList object for my GUI application? I Did It Your Way, 11.95 The History of Scotland, 14.50 Learn Calculus in One Day, 29.95 Feel the Stress, 18.50 Great Poems, 12.95 Europe on a Shoestring, 10.95 The Life of Mozart, 14.50

Member Avatar
+0 forum 1
Member Avatar

i want to know how to add put images or array of image (icon) in a JList any helpp .

Member Avatar
+0 forum 1
Member Avatar

I'm having trouble figuring this out. I have 3 jlists and each one has a textbox and a "add" button so the user can enter text to be added to the list. I have read probably a dozen webpages or forum posts on this and all have pretty much the same code advice for doing this. The problem I'm having is that none have said or shown how the code actually links the button to the jlist1, jlist2, and jlist3 respectively. What am I missing?? Here is the code I have and not sure what to change or add. private …

Member Avatar
+0 forum 4
Member Avatar

Ok so lets say I have any GUI that needs its contents changed while it is running, so that it will re-display the new contents. An example would be in my defaultlistmodel it would have: Exactors Diggers But once the user selects "Exactors" and moves to a new GUI which is displayed such as Mini Cars And then goes back and selects Diggers - both Cheese and Beans remain in every further category that i add but i want each category to have its own seperate subCategories

Member Avatar
+0 forum 10
Member Avatar

GUI class with the list. What i want to do is have another class add to this list when button is clicked but im not sure how to do that. [CODE] public class LView extends MasterViewPanel{ private static final long serialVersionUID = 1L; private JButton host, join, quit, start; private JLabel plLabel, title, title2; private JList players, square; private DefaultListModel playerModel; private LobbyModel lm; private Player pl; public LView(RiskMasterView m) { super(m); setUpLayout(); setUpLists(); setUpButtons(); setUpLabels(); } private void setUpLayout() { this.setLayout(null); this.setBackground(Color.black); this.setSize(640,480); } private void setUpLabels() { plLabel = new JLabel("Player List"); plLabel.setSize(400,150); plLabel.setLocation(530, 100); plLabel.setFont(new Font("Roman",1, 30)); …

Member Avatar
+0 forum 3
Member Avatar

Hi all, Im new to java, and im working with j lists importing data from sql server. Thing is that i can import the data from the sql tables, but for some reason it does not refresh properly. Thing is that when the frame is opened the list is filled with some data, when i add something else, it should only add the new thing, BUT it adds all the pre-existing stuff plus the new row, when trying to delete something, the program (to what already is in the list), all again but without the item i deleted, and when …

Member Avatar
+0 forum 4
Member Avatar

I have to make a bank GUI and I have a Jlist that populates with the customer objects (viewable by name) and I can view their individual info... but when I select the customer, I also want to be able to pull their account info and put it in a jtable that is on the same frame. I have a class to create a model for the table (I don't need that, but was trying to figure it out)... I got it to work to put in customer info, but I can't get it to put in account info... Can …

+0 forum 0
Member Avatar

I once upon a time had problems with buttons and getting windows to show up, now cannot get output of loan data into JList, code is below, any suggestions? next change is to add array (which I think I can do) and graphics in the form of a graph but one step at a time. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; import java.text.NumberFormat;// import to display money public class loanGUI2 { private String intPd; private double interestPaid; private String lnAmt; private double loanAmount; private String prinPd; private String lnPmt; private String bal; private double balance; private double loanPayment; …

Member Avatar
+0 forum 1
Member Avatar

Hi all, I'm currently trying to solve a problem with a JList. I've got an actionPerformed event applied to the JList (also tried the item updated event but it has the same effect), and whenever this event is fired, (i.e. the user makes a selection), something happens. Now, the problem is that when the list is being populated, it seems to fire the event too - thus creating problems for me. Is there a way to stop the JList from firing the actionPerformed or itemStateChanged event when the contents is updated? Thanks P.S. Question has also been asked here: [url]http://www.java-forums.org/awt-swing/41914-how-stop-jlist-firing-events-when-contents-updated.html#post195009[/url]

Member Avatar
+0 forum 7
Member Avatar

hey, i got a method that returns value which is java.util.List<java.lang.String>. this method actually contain data that was stored from .txt file which is simply names of people. how can i display this in the JList or how can i convert this value to a simple array so later i can work with it. this is a method that i need to work with [CODE] public StringArray displayNames() { StringArray name= new StringArray(); name.add("tom"); name.add("james"); name.add("lawrence"); return name; } [/CODE] i call this method and the value returned from it needs to be displayed in JList Thank You

Member Avatar
+0 forum 4
Member Avatar

Note: I'm using a JList as an audio playlist. I was wondering if there was a way to automatically update a custom ListCellRenderer. Basically I ask is because within my ListCellRenderer I have an isPlaying item that will change the color of the object in my playlist that is playing, however when the next file begins to play the previous item that was playing will remain the playing color until I highlight it with the focus and then the CellRenderer updates it. Hope I'm explaining this enough to be understood. Maybe you have another idea to go about what I'm …

Member Avatar
+0 forum 4

The End.