main JFrame
public class ProjectM extends JFrame
{
private String fileName;
private int width;
private int height;
private String ImageLocation;
private int tileSize;
private ContextPane CP = new ContextPane();
public ProjectM()
{newAction.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
CP.setVisible(true);
if(CP.stateval() == false)
{
fileName = CP.Get_File_Name();
width = CP.Get_Width();
height = CP.Get_Height();
ImageLocation = CP.Get_Tile_Directory();
tileSize = CP.Get_Tile_Size();
}
System.out.println(fileName);
System.out.println("What would you like to call your new map?");
}
});
}
popup JFrame
public class ContextPane extends JFrame
{
private String fileName;
private String tileDirectory;
private int tileSize;
private int height;
private int width;
private boolean state;
public ContextPane()
{
JButton Cancel = new JButton("Cancel");
Cancel.setBounds(155,201,80,22);
Cancel.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
exit();
}
});
this.add(Cancel);
public void exit()
{
this.setVisible(false);
state = false;
}
public boolean stateval()
{
return state;
}
}
Right now when you click the newaction button it pops the window up and continues going with the button click. but i want it to wait for the window to close before it moves on.
This post has been edited by giuseppe105: 23 May 2010 - 05:07 PM

New Topic/Question
Reply




MultiQuote









|