Re: JFrame from JPanel
- From: RedGrittyBrick <RedGrittyBrick@xxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 20:13:07 +0000
petoeter wrote:
This is e real newbie problem.
I created a JPanel :
public class P1 extends JPanel implements ActionListener {
some code
}
On a different file, but in the same dir, I have a JFrame:
public class F1 {
JFrame ditframe = new JFrame {
some code
}
I try to start the JFrame from the JPanel somewhere under:
public void actionPerformed(Action Event e) {
.....
}
How d I call the JFrame?
Probably by making ditframe an instance variable, providing a method in F1 that does "ditframe.setVisible(true);", then calling that method from P1 after instantiating F1.
If that doesn't make any sense to you then read this
http://mindprod.com/jgloss/sscce.html
.
- Follow-Ups:
- Re: JFrame from JPanel
- From: Brandon McCombs
- Re: JFrame from JPanel
- References:
- JFrame from JPanel
- From: petoeter
- JFrame from JPanel
- Prev by Date: Re: Automatically resize font when component size changes?
- Next by Date: Re: How to print a JTextArea?
- Previous by thread: JFrame from JPanel
- Next by thread: Re: JFrame from JPanel
- Index(es):
Relevant Pages
|