open another jframe

  • Follow


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
0
Reply Akki 1/24/2008 11:57:38 AM

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
0
Reply Knute 1/24/2008 6:48:46 PM


On Jan 24, 11:48 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
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 ?
0
Reply Akki 1/25/2008 8:45:55 AM

Akki wrote:
> On Jan 24, 11:48 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
> 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);
0
Reply RedGrittyBrick 1/25/2008 10:51:22 AM

3 Replies
584 Views

(page loaded in 0.271 seconds)

Similiar Articles:













7/21/2012 8:20:38 AM


Reply: