Convert cold to older version
I'm using NetBeans and I didn't see a section other than here that matched the topic any better. I've developed this application on JRE 1.6. Come to find out our system at work uses JRE 1.4.2 as of currently. Because the system is on a GRID device, I have no way to update to JRE 1.6. Is there any simple way for me to convert from 1.6 to 1.4.2 in NetBeans? I figure I will need to do some manual refactoring, but it seems dumb to not have a feature like that, or maybe I'm dumb for not developing in a more commin JRE version.
1.6 code:javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
1.4.2 code:org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
I've been reading that setMinimumSize on a JFrame only works 1.5 and higher. What can I do to set the minimum frame size of 800 x 600 in 1.4.2?
It worked fine in 1.6, but since I can't use it in 1.4, I went a different route. Now I'm using the following to set the frame size to 800 x 600, center it, and make it impossible to resize. Witht the code below, it first opens basically as 0x0 (which is centered in the screen. Then, the frame size changes to 800 x 600 after already centered meaning it will display 800 x 600 off the screen and I need to drag it to the center. Any ideas?
setMaximizedBounds(new java.awt.Rectangle(0, 0, 800, 600));
addComponentListener(new java.awt.event.ComponentAdapter()
{
public void componentResized(ComponentEvent event)
{
setSize(
Math.max(800, getWidth()),
Math.max(600, getHeight()));
}
});
// Set the frame center to the screen
Dimension dim = getToolkit().getScreenSize();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension size = this.getSize();
System.out.println (this.getSize());
screenSize.height = screenSize.height/2;
screenSize.width = screenSize.width/2;
size.height = size.height/2;
size.width = size.width/2;
int y = screenSize.height - size.height;
int x = screenSize.width - size.width;
this.setLocation(x, y);
setVisible(true);
setName("HubEvals");
setResizable(false);