File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Java Swing- taking inputs based on a previous user input. Please help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java Swing- taking inputs based on a previous user input. Please help!" Watch "Java Swing- taking inputs based on a previous user input. Please help!" New topic
Author

Java Swing- taking inputs based on a previous user input. Please help!

Kritika Kamath
Greenhorn

Joined: May 18, 2012
Posts: 2
Hi,

I'm developing a Swing application for the first time, so please forgive me if my doubt is a little naive.

To test my application, I have currently hardcoded some text labels and fields in a JPanel, so that a user can enter input details for a maximum of 3 segments. But this limits the maximum number of segments to 3. However, the requirement is that when the user enters the number of segments (could be greater than 3 as well), corresponding number of input sets need to be taken.

Screenshot attached, with values entered.

Basically I want to know how I should go about taking the inputs from the user.

Thanks in advance!


[Thumbnail for hAUL ROUTE INFO.png]

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2227
    
    8
I would probably use a JTable. Then you create an "Add Segment" button to add a new row to the JTable.

Read the section from the Swing tutorial on How to Use Tables for more information and examples.
Kritika Kamath
Greenhorn

Joined: May 18, 2012
Posts: 2
Thanks Rob! I will try that..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Presumably you can write a non‑GUI application which stores its state somehow.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Swing- taking inputs based on a previous user input. Please help!