Minor GUI code update. Still not functional!
This commit is contained in:
parent
0ab47fdd19
commit
860a5f72b2
32
src/morlok8k/MinecraftLandGenerator/GUI/MLG_GUI.java
Normal file
32
src/morlok8k/MinecraftLandGenerator/GUI/MLG_GUI.java
Normal file
@ -0,0 +1,32 @@
|
||||
package morlok8k.MinecraftLandGenerator.GUI;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
public class MLG_GUI extends JFrame {
|
||||
|
||||
private static final long serialVersionUID = -8791419906463664152L; //auto generated
|
||||
private JPanel contentPane;
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
public MLG_GUI() {
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setBounds(100, 100, 450, 300);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
setContentPane(contentPane);
|
||||
|
||||
JLabel lblHelloWorld = new JLabel("Hello World");
|
||||
lblHelloWorld.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
contentPane.add(lblHelloWorld, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package morlok8k.MinecraftLandGenerator;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -13,6 +14,8 @@ import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import morlok8k.MinecraftLandGenerator.GUI.MLG_GUI;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Corrodias, Morlok8k, pr0f1x
|
||||
@ -69,34 +72,38 @@ public class Main {
|
||||
NOGUI = true;
|
||||
}
|
||||
|
||||
//GUI Choosing code...
|
||||
//MLG_GUI Choosing code...
|
||||
if (!java.awt.GraphicsEnvironment.isHeadless() || (!NOGUI)) {
|
||||
GUI = true;
|
||||
if (var.testing) {
|
||||
Out.outD("GUI: This is a graphical enviroment.");
|
||||
Out.outD("MLG_GUI: This is a graphical enviroment.");
|
||||
}
|
||||
|
||||
//////
|
||||
GUI = false; // forcing GUI to be false for now, because I don't have the GUI code ready yet!
|
||||
GUI = false; // forcing GUI to be false for now, because I don't have the MLG_GUI code ready yet!
|
||||
//////
|
||||
|
||||
} else {
|
||||
GUI = false; // No GUI for us today...
|
||||
if (var.testing) {
|
||||
Out.outD("GUI: Command Line Only!");
|
||||
Out.outD("MLG_GUI: Command Line Only!");
|
||||
}
|
||||
}
|
||||
|
||||
if (GUI) { //GUI
|
||||
// Launch GUI
|
||||
// Launch MLG_GUI
|
||||
|
||||
/*
|
||||
try {
|
||||
Main()).runGUI(args;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
MLG_GUI frame = new MLG_GUI();
|
||||
frame.setVisible(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else { //No GUI
|
||||
// Finally, Lets Start MLG!
|
||||
|
Reference in New Issue
Block a user