Khoram
April 23rd, 2009, 04:13 PM
I have an app that was working fine in 1.6_11, that now does not work in _13. I used a code snippet I saw somewhere to show a splashscreen image on startup, that is then replaced with the actual drawing canvas after a short thread sleep. In _13, however, the image used for the splashscreen stays drawn on top of everything else that is added afterwards.
public class BattleHex extends JFrame {
WrapBattleHex wbh;
private static final String MAP_DIR = "JCreator LE/MyProjects/BattleHex/maps/";
JButton selectHexButton, placeUnitButton, moveUnitButton;
public BattleHex()
{
super("BattleHex");
Container c = getContentPane();
c.setLayout( new BorderLayout() );
wbh = new WrapBattleHex(); // panel holding the 3D canvas
c.add(new JButton(new ImageIcon("BattleHexLogo v01.png")), BorderLayout.CENTER);
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
pack();
setResizable(true);
setVisible(true);
// show splash sceeen title logo for 1 second, then replace with game canvas
try { Thread.sleep(1000); }
catch (Exception e) { e.printStackTrace(); }
c.add(wbh, BorderLayout.CENTER);
pack();
} // end of BattleHex()
public static void main(String[] args) {
new BattleHex();
}
} // end of BattleHex class
Any ideas?
public class BattleHex extends JFrame {
WrapBattleHex wbh;
private static final String MAP_DIR = "JCreator LE/MyProjects/BattleHex/maps/";
JButton selectHexButton, placeUnitButton, moveUnitButton;
public BattleHex()
{
super("BattleHex");
Container c = getContentPane();
c.setLayout( new BorderLayout() );
wbh = new WrapBattleHex(); // panel holding the 3D canvas
c.add(new JButton(new ImageIcon("BattleHexLogo v01.png")), BorderLayout.CENTER);
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
pack();
setResizable(true);
setVisible(true);
// show splash sceeen title logo for 1 second, then replace with game canvas
try { Thread.sleep(1000); }
catch (Exception e) { e.printStackTrace(); }
c.add(wbh, BorderLayout.CENTER);
pack();
} // end of BattleHex()
public static void main(String[] args) {
new BattleHex();
}
} // end of BattleHex class
Any ideas?