open a jframe using a button

I

iszekeell

ok, I believe you will find this easy,
I've created 2 jframes in the same package testForum and addForum,
what I'm trying to do is open/call addForum from a button in
testForum, they are both in the same package, and I've use NetBeans to
create them.
can you help me please
 
S

Sanjay

ok, I believe you will find this easy,
I've created 2 jframes in the same package testForum and addForum,
what I'm trying to do is open/call addForum from a button in
testForum, they are both in the same package, and I've use NetBeans to
create them.
can you help me please
I just have one application experience of creating a swing application,
so my answer may not be 100% right.

I think you should create two panels within the same frame and show and
hide that instead of creating two separate frames.

What I did in my last application was, create a class which has handles
to all the panel classes and keep a pointer to that class in each panel
classes. Then I would just call show and hide methods. Hope this makes
sense.
 
I

iszekeell

thanks for the reply
tried it and it dose work, wasn't quite what i wanted but have a
solution

private void addButtonActionPerformed(java.awt.event.ActionEvent evt)
{
this.setVisible(false);
addAssetForm addasset = new addAssetForm();
addasset.setVisible(true);
}
just create a new instance of the next form and then kill/hide the
other form

thanks again sorry for not getting back
sooner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top