Results 1 to 11 of 11
- 08-05-2010, 03:32 PM #1
Member
- Join Date
- May 2010
- Posts
- 32
- Rep Power
- 0
Different components in an AWT list
Hi All
I am trying to do some enhancements to a legacy AWT application and basically I need to create a list of addable/removable rows where each row has a button in column 1, 2 radio-buttons/check-boxes in col2, 2 text boxes in cols 3&4 and then a drop down list in col 5 and then a button again in col 6.
Is there a component in AWT that i can make use of?
Also it would be very difficult for me to use 3rd party components/libraries so if you can point me in the right direction whether it be examples or existing components your help would be much appreciated.
ps: I have created a prototype of what I want to do in MS Paint and have attached with this post.
many thanks in advance :)
- 08-05-2010, 04:13 PM #2
If your layout is rows and columns:
Have you looked at either of the Gridxxx layout managers?
-
I would also consider using a JTable here. You can set up your editors and renderers to behave like buttons, collections of radio buttons, and drop down lists.
- 08-05-2010, 04:52 PM #4
Member
- Join Date
- May 2010
- Posts
- 32
- Rep Power
- 0
The number of rows can grow dynamically and several components in each row will have events registered against them(button clicks, drop down selection changes etc). Not sure how I would create event handlers for dynamically generated components.
I had a discussion with a colleague and he suggested using a panel to represent a row and then create a RowClass which returns a panel to its caller with all the components and their respective event handlers all encapsulated in that RowClass . I have a feeling with this method the formatting might become a nightmare....
- 08-05-2010, 04:53 PM #5
Member
- Join Date
- May 2010
- Posts
- 32
- Rep Power
- 0
Sorry cant use any Swing(JTable ) components :(
- 08-05-2010, 05:00 PM #6
This is while the program is running? Then there is a GUI problem to update the display to show the new rows as they are added.number of rows can grow dynamically
What are "dynamically generated components"? All components are created by using new.dynamically generated components
How would these differ from any other?
I don't know why the event handlers would be a problem. As the new GUI components are created and added to the GUI, the event handlers could be added to those components.
- 08-05-2010, 05:20 PM #7
Member
- Join Date
- May 2010
- Posts
- 32
- Rep Power
- 0
Hi Norm
Cheers for your replies....
If you look at the snapshot that I have attached with this post there is an add row button on the gui. And the user will start off with a single row but could keep adding rows dynamically.
In which case say if I want to have an event handler method registered for the button click in column7 then how would I find out which row the button was clicked in ? say if I need to use the value entered in the corresponding text box in column 4
- 08-05-2010, 05:27 PM #8
Extend the button class and have a variable in the class with its row number.how would I find out which row the button was clicked in
Or a more structured approach would have an object for each row that the components on the row could access to get at its fellow components on that row.
- 08-07-2010, 05:55 AM #9
Member
- Join Date
- Aug 2010
- Posts
- 4
- Rep Power
- 0
Moderator edit: - deleted -
Last edited by Fubarable; 08-07-2010 at 01:46 PM.
-
karthi66: do not hijack someone else's thread.
- 08-13-2010, 10:39 AM #11
Member
- Join Date
- May 2010
- Posts
- 32
- Rep Power
- 0
Similar Threads
-
How do I list values of an arrays in a comma seperted list
By nmvictor in forum New To JavaReplies: 2Last Post: 11-22-2009, 05:24 PM -
How do I list values of an arrays in a comma seperted list
By nmvictor in forum New To JavaReplies: 3Last Post: 11-21-2009, 05:48 PM -
how to create list of list in java ???
By ilayaraja in forum Advanced JavaReplies: 1Last Post: 10-26-2009, 04:30 PM -
Linked List integer list
By igniteflow in forum Advanced JavaReplies: 1Last Post: 12-10-2008, 08:53 PM -
How to access ArrayList in List of List?
By alvations in forum New To JavaReplies: 5Last Post: 10-08-2008, 12:23 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks