Updating JFrame.

Everyone,I am very new to java. I am trying to generate a report and put the report in the same frame as the input frame(where I gave the input for generating report.)Can I do it? And how?Regards,Minal
[243 byte] By [M_Danga] at [2007-11-26 16:23:50]
# 1
Yes, it's possible in many ways.For example, remove the unnecessary components:remove()and create new components for your report.
stoppera at 2007-7-8 22:47:40 > top of Java-index,Java Essentials,New To Java...
# 2
I am not that sure but have you seen at CardLayout
qUesT_foR_knOwLeDgea at 2007-7-8 22:47:40 > top of Java-index,Java Essentials,New To Java...
# 3

Hi,

Yes you can do it. First create a JLabel with no values like:

JLabel jl = new JLabel("");

By using setBounds() set its position at the end part of the frame.

Now when you have generated your report, (most probably by clicking a button), in the action part give ,

jl.setText(report);

where report is the String variable representing the report you have generated.

If you report is too big to contain in a String, then use any other component in the same manner.

Best Regards,

Cochu.

Cochua at 2007-7-8 22:47:40 > top of Java-index,Java Essentials,New To Java...
# 4
[url= http://java.sun.com/j2se/1.5.0/docs/api/java/awt/CardLayout.html]CardLayout[/url]You can create all the different "screens" on different JPanels, then add them all to the CardLayout. Also; in the future, Swing questions should be posted in the Swing forum.
CaptainMorgan08a at 2007-7-8 22:47:40 > top of Java-index,Java Essentials,New To Java...
# 5
Thanks a lot.Regards,M_Dang
M_Danga at 2007-7-8 22:47:40 > top of Java-index,Java Essentials,New To Java...