Example #1
0
 public static void initGui(MinecraftServer minecraftserver)
 {
     try
     {
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     }
     catch (Exception)
     {
     }
     var servergui = new ServerGUI(minecraftserver);
     var jframe = new JFrame("Minecraft server");
     jframe.add(servergui);
     jframe.pack();
     jframe.setLocationRelativeTo(null);
     jframe.setVisible(true);
     jframe.addWindowListener(new ServerWindowAdapter(minecraftserver));
 }
		/**
		 * Main program (used when run as application instead of applet).
		 */
		public static void main(String[] args)
		{
			DelaunayAp applet = new DelaunayAp();  // Create applet
			applet.init();                         // Perform applet initialization
			JFrame dWindow = new JFrame();         // Create window
			dWindow.setSize(700, 500);             // Set window size
			dWindow.setTitle("Voronoi/Delaunay Window");
			// Set window title
			dWindow.getContentPane().setLayout(new BorderLayout());
			// Specify layout manager
			dWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			// Specify closing behavior
			dWindow.getContentPane().add(applet, "Center");
			// Place applet into window
			dWindow.setVisible(true);              // Show the window
		}