two frames open
hi, i have got a problem with a program i am developing, i have got a JFrame and one of the buttons opens up another JFrame. the problem i am having is that the second window does not open properly. The panel shows but all the information on it is absent. I have tried setting the visibility status of the first frame to false when the second one opens, but this does not work. Does anyone have any ideas?
[412 byte] By [
Delaicerwa] at [2007-10-3 10:46:43]

unfortunately,
that does not work in my case. Wot i have is a Swing GUI which has fields to edit info. When a button is pressed, another class is called which calls another class which shows another GUI that only displays graphical information. My problem is that the frame for the 2nd gui opens up but it does not disply any information. Is there a type of flush function i can call to refresh the screen, or does anyone have any suggestions
Thanks
i am basically tyring to run a rabbit fox simulation but with a gui that when you click start is opens to field. I dont want to display all the source code from the original rabbit fox as it is quite alot, but you can find it here:
http://www.cs.luc.edu/~pld/courses/170/spr06/lab10/foxrabbit.zip.
Below is the GUI code i add
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class simGUI extends JFrame implements ActionListener {
JButton start = new JButton("start");
JPanel pane;
public simGUI(){
super("test");
setSize(50,50);
pane = new JPanel();
start.addActionListener(this);
pane.add(start);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setContentPane(pane);
show();
}
public void actionPerformed(ActionEvent evt)
{
Object src = evt.getSource();
if (src == start){
Simulator sim = new Simulator();
sim.runLongSimulation();
}
}
}
with out this code, the sim rums, but when i use the gui to start the sim, the field does not display until the end of the simulation. Any suggestions why?