Forums Register Login

Swings

+Pie Number of slices to send: Send
Hi all,

I am working on a swing application that retrives the details of flights that take off on a particular date and span of time.I want to limit my JTextFields(that diplays the flight name) & Jbutton that retrieves details based on the no of flights retrieved.Can any Swingers help me Swing thro this

Hari
SCJP
+Pie Number of slices to send: Send
I can probably get you a start, but I don't at all understand what you are trying to do. Are you trying to display labels and text fields dynamically?

From where are you retrieving the data?
+Pie Number of slices to send: Send
hi alan

The application looks somewhat like this.
A.There is a Flight Plan page that takes in the date and route of flights.
B.The next page retrieves the names Flight id/nums that are flying ont tht date at that time from the DB.Now, this is where i need the dynamic textfields and buttons, ie, I want to limi the tf's and but's to the number of flights retrieved.That is 10 Flights 10 tf's ,20 -20 and so on dynamically.
TextField ------>Flight Id/Name Button------>(named details)to retieve details from the DB.

Hope u can help me.

hari
+Pie Number of slices to send: Send
Ok, I think I understand what you are trying to do... I'll start with some rough psuedocode and see if that helps you understand. (This is just how I would do it, and there are many different ways it can be done)



The actual code for dynamically creating buttons is not too hard... do the buttons need listeners?

The loop will look something like this:

Now, to create the panel, you just need a loop to extract the elements. Depending on which version of Java that you have, you will have to cast the button back when you want to add it to your panel or frame, ie:
myPanel.add((JButton)flightNumbers.get(i)
myPanel.add((JLabel)flightTimes.get(i)

Does that get you going a little?

[ April 28, 2005: Message edited by: C. Alan ]
[ April 28, 2005: Message edited by: C. Alan ]
+Pie Number of slices to send: Send
Thank Alan!
It seriously got me going!!???
But, its all very vague.Any ways I will try it!!! and get back to you!!

Bye
+Pie Number of slices to send: Send
Hi Narahari,
I would suggest you to use a GridLayout for the couples JTextField/JButton.
Once you retrieve how many flight/textfield/buttons you need, you can create a grid that will contain all the textfields and buttons you need.
If you need to update the entire thing in a second moment, you can still remove the components in the panel where you put the grid and redo the same thing.

I hope this helps
Giovanni
+Pie Number of slices to send: Send
I know it's vague.. the idea was to get you started on your project, and then as you progress, we can help you work through different aspects.
+Pie Number of slices to send: Send
HI All,

Well its all fine!!!i shall come back with many more.....

bye
Thank You Al..an
Yes, my master! Here is the tiny ad you asked for:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 889 times.
Similar Threads
how to support java Client and browser?
partII: stateful session bean is necessary to serve as a booking cart?
Unsaved Itinerary
Final submission requirement
Drag and Drop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:54:19.