package ei.engine; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JButton; import org.lwjgl.LWJGLException; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Properties; import javax.swing.JLabel; public class LWJGLPropertiesDialog implements ActionListener{ public static final int SOW_ONCE = 0; public static final int SOW_ALWAYS = 1; private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="57,133" private JCheckBox fullscreen = null; private JPanel jPanel = null; private JComboBox resulution = null; private JComboBox pixelres = null; private JComboBox freq = null; private JButton ok = null; private JButton cancel = null; private JLabel jLabel = null; private JLabel jLabel1 = null; private JLabel jLabel2 = null; private LWJGLGameWindow window; private DisplayMode[] display; public static void main(String[] args){ } public LWJGLPropertiesDialog(LWJGLGameWindow window, int status){ try { display = Display.getAvailableDisplayModes(); } catch (LWJGLException e) { e.printStackTrace(); } this.window = window; Properties settings = loadProp(); getJFrame(display); if(settings != null){ setSelected(resulution,settings.getProperty("Res")); setSelected(pixelres,settings.getProperty("Pixel")); setSelected(freq,settings.getProperty("Freq")); fullscreen.setSelected(Boolean.parseBoolean(settings.getProperty("Fullscreen"))); if(status == SOW_ONCE){ actionPerformed(new ActionEvent(ok,0,"loaded settings")); } else if(status == SOW_ALWAYS){ jFrame.setVisible(true); } } else{ jFrame.setVisible(true); } } private void setSelected(JComboBox box, String sel){ for(int i=0; i list = new ArrayList(); for(int i=0; i list = new ArrayList(); for(int i=0; i list = new ArrayList(); for(int i=0; i Integer.parseInt(list[j])){ String temp = list[i]; list[i] = list[j]; list[j] = temp; } } } } }