[nbusers] Calling JFrame from another class

  • From: "daeva112" < >
  • To:
  • Subject: [nbusers] Calling JFrame from another class
  • Date: Thu, 03 Jan 2013 06:35:35 -0500


kimp_07 wrote:
> 
> Code:
> import your_frame_class;
> 
> 
> 
> NB automatically organize imports.
> after that
> 
> 
> Code:
> YourFrame frame = new YourFrame();
> frame.setVisible(true);
> 
> [/code]


Didn't work. Created new class named test1 in the same package named xxx. Ex 
main class name is test.
type import xxx.test1; on top of class test

added jbutton in test class.

Code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
menu menu1=new menu();
menu1.setVisible(true);}



and NetBeans showed 
cannot find symbol
symbol: class menu
location: class test

Btw I have also changed variable modifiers of menu jframe in class test1 to 
public






[nbusers] Calling JFrame from another class

daeva112 01/03/2013

[nbusers] Calling JFrame from another class

kimp_07 01/03/2013

[nbusers] Calling JFrame from another class

daeva112 01/03/2013

[nbusers] Re: Calling JFrame from another class

Bayless Kirtley 01/04/2013

[nbusers] Calling JFrame from another class

daeva112 01/04/2013

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close