#Creating a custom data when clicking row in JTable

13 messages · Page 1 of 1 (latest)

fiery flare
#

When any row in the JTable is clicked, I am trying to create a special database for that row and open a new JFrame. So actually I want to create a custom page for each row. For example, there are 5 rows in JTable, and when I click on each row, a new frame will open and a special text will be written for each row in a JLabel inside the frame (of course, the user will set what to write ). How can I do that?

scarlet cairnBOT
#

This post has been reserved for your question.

Hey @fiery flare! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

broken cloud
#

Why don't you use GridLayout with buttons

#

or use ActionListener

#

this will fire and event and each time that the cell is clicked just create a new Framwe

fiery flare
broken cloud
#

that will remember user input even after the termination of JVM

broken cloud
#

By a database you mean that will remember user input even if he close the aplication

broken cloud
#

ok I try that one time and I figgured out that with FIleReader and FileWriter and some regex you could write the user input in a txt file and it read it back when you will reuse the program

green rampart