Re: open another jframe



Akki wrote:
On Jan 24, 11:48 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
Akki wrote:
Hi,
How do I open another JFrame from one JFrame ?
The first JFrame is a command prompt. Where I want to write draw f(x).
Then I want to open another JFrame inwhich I show the plot of f(x).
TIA,
Darth
You create a new JFrame object with the new operator and then you call
the setVisible() method on that object with an argument of true.

--

Knute Johnson
email s/nospam/knute/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem

Thanks ! I it worked. But now when I close the second JFrame window,
the first one closes too.
How do I decouple them ?

f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
.



Relevant Pages

  • Re: Is a JFrame threaded?
    ... button on the first JFrame. ... The JFrame captures a file name and calls ... Is this anything to do with threading? ...
    (comp.lang.java.programmer)
  • pb repaint JFrame
    ... I have an application with two JFrame. ... When I do a synchronized action who take a long time from the ... second JFrame and when I move the JFrame in ... that erase the first JFrame. ...
    (comp.lang.java.gui)
  • Re: open another jframe
    ... How do I open another JFrame from one JFrame? ... The first JFrame is a command prompt. ... Where I want to write draw f. ... You create a new JFrame object with the new operator and then you call the setVisiblemethod on that object with an argument of true. ...
    (comp.lang.java.gui)
  • Re: How to connect to other JFrame ?
    ... After I clicked first JFrame, ... I would like to close the first JFrame when second JFrame is open. ... SelectFacilities selectfac = new SelectFacilities; ...
    (comp.lang.java.gui)
  • Re: pb repaint JFrame
    ... > I have an application with two JFrame. ... > When I do a synchronized action who take a long time from ... that erase the first JFrame. ... may be you should use JDialog instead of second JFrame. ...
    (comp.lang.java.gui)