Thread View: aus.computers.java
2 messages
2 total messages
Started by Steve Heron
Fri, 14 May 1999 00:00
newbie ? about multiple frames
Author: Steve Heron
Date: Fri, 14 May 1999 00:00
Date: Fri, 14 May 1999 00:00
18 lines
1211 bytes
1211 bytes
Hi Java ppl, hope someone can straighten me out - i'mm writing an app for an assignment. First class creates a frame (no problem), which closes normally using WindowAdapter/WindowClosing/ System.exit(0) This frame calls a second frame, which for the life of me I cant get to close and return to the first frame. I know the solution is bound to be simple, slap my head in disbelief sort of stuff, but I've searched the API high and low, looked up books (online and off), but all i can find is single frame application examples. Can someone please put me out of my misery. TIA Steve
Re: newbie ? about multiple frames
Author: minirich
Date: Sat, 15 May 1999 00:00
Date: Sat, 15 May 1999 00:00
44 lines
2240 bytes
2240 bytes
a actionlistener will start this sequence
gamefr = new JFrame("BlackJack"); // new frame you want
bj = new BlackJack(this); //object for new frame
gamefr.addWindowListener(new WL()); //add the windowlistener to
fram
gamefr.getContentPane().add(bj,BorderLayout.CENTER); // add
Objecet in center to new contentpane
gamefr.setSize(600,250); //set framesize
bj.init(); //start init of object
bj.start(); //run run of object
visible(gamefr,true); //set visibility of new frame true see below
visible(editfr,false);//set visibility of old frame false see below
public void visible(Frame frame,boolean vis) //Method for visibility
{ //frame ist the frame u want to set, vis is the state u want to set
frame.setVisible(vis); //original commant frame comes from above
vis comes from above
}
Steve Heron schrieb in Nachricht <7hgmom$k6v$1@dove.qut.edu.au>...
>Hi Java ppl,
>
>hope someone can straighten me out - i'mm writing an app for an assignment.
>
>First class creates a frame (no problem), which closes normally using
>WindowAdapter/WindowClosing/ System.exit(0)
>
>This frame calls a second frame, which for the life of me I cant get to
>close
>and return to the first frame. I know the solution is bound to be simple,
>slap my head in disbelief sort of stuff, but I've searched the API high and
>low, looked up books (online and off), but all i can find is single frame
>application examples.
>
>Can someone please put me out of my misery.
>
>TIA
>Steve
>
>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads