Skip to main content

All Questions

Tagged with
-2 votes
1 answer
2k views

How to display a list of objects as a JList in java swing?

We are asked to build a system in Java Swing no drag and drop and I cannot understand how to display a list of objects in a JList. I have a GUI class that creates a JFrame, JPanel, and an empty JList ...
rainbow's user avatar
0 votes
1 answer
705 views

Combining arraylists of different object types into one

I have some arraylists which contain objects (for a paint like program) based on a constructor in a class, and wish to put them all in the same arraylist rather so each item redraws in order. ive ...
Anan's user avatar
  • 81
0 votes
1 answer
562 views

Save Selected JTable Rows and Show them in another JTable (in another JFrame)

I have a table with some data. I want to select a couple of rows which I want to monitor (I will then display these rows in a new JFrame with its own table) - let's call this monitored records. I ...
JackPeters667's user avatar
0 votes
0 answers
153 views

How to take User input in one frame and adding it to an arraylist to display on another frame

how do you get the User input inside JTextFeild and SET/ADD the input to the table in another frame? Student objects are stored in an ArrayList. The array list is added to table view and displayed in ...
Tom L.'s user avatar
  • 1
0 votes
1 answer
729 views

JTable storing row values as object

At the moment, i have a table that has no row values when it is built, rows are added in after i click the add button. when i click the add button, it will add a row to the table and there are cells ...
Roy Johnson's user avatar
-1 votes
1 answer
51 views

can't added my object to to ArrayList

i tried to add an object to ArrayList ? but ican't whyyyyyy ? ArrayList<Patient> emer; Patient p = new Patient(); p.setName(jTextField1.getText()); p.setSurname(jTextField2.getText()); p....
Abdurrahman Alabrash's user avatar
0 votes
5 answers
132 views

Arraylist of Objects - How do I remove an entry?

I am doing homework and it states that I have to be able to remove a entry from an arraylist of objects. I try to check if it contains the user id I want to remove but objects cannot contain strings ...
Traplord's user avatar
  • 101
0 votes
1 answer
635 views

How do I implement backup and restore using serialisation with multiple classes?

Im trying to serialise objects(Names and notes) which I store in my JTable. I want to be able to save this information to a file and when I load the program, the information should load into the ...
Java's user avatar
  • 3
0 votes
1 answer
82 views

drawing out objects from an array

Sorry for asking a question again guys, but im stumped yet again, Arraylists just dont like me ;). Now im stuck with the problem of drawing out the objects, they wont be drawn except for maybe one in ...
user3078872's user avatar
3 votes
3 answers
5k views

Adding rows to JTable in the right order.

I am writing a code in which data is collected from an arraylist of arrays, which I add to a JTable. However, the code always adds the data bottom-side up, so if there are two rows of data, it adds ...
sparkonhdfs's user avatar
  • 1,333
0 votes
3 answers
5k views

Java: Filling a JComboBox with objects

I'm trying to fill a jComboBox with objects. I have it working in one class, but in this class it's giving a NullPointerException but the code is almost the same. What am I missing here? The code I'm ...
Forza's user avatar
  • 1,639
3 votes
1 answer
7k views

Adding an array to a combo box

I want to add an array to an existing combobox without passing the array object as a argument in the constructor. Is there perhaps a way to do this by using a method? Something like the following ...
Arianule's user avatar
  • 8,943