Java Code Examples for javax.swing.JFrame.setLocationByPlatform()

The following are Jave code examples for showing how to use setLocationByPlatform() of the javax.swing.JFrame class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: QN-ACTR-Release   File: QnactrSimulation.java   View Source Code Vote up 6 votes
public static void createAndShowTaskVisualization2DViewerGUI() {
  frameTaskVisualization2DViewer  = new JFrame("TaskVisualization2DViewer");
  frameTaskVisualization2DViewer.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  
  taskVisualization2D = new TaskVisualization2D();
  taskVisualization2D.setOpaque(true); //content panes must be opaque
  frameTaskVisualization2DViewer.setContentPane(taskVisualization2D);

  frameTaskVisualization2DViewer.pack();
  frameTaskVisualization2DViewer.setLocationByPlatform(true);
  frameTaskVisualization2DViewer.setVisible(true);
  
  int x = simulatedWindowDefaultSizeX + taskVisualization2DExtendSizeX;
  int y = simulatedWindowDefaultSizeY + taskVisualization2DExtendSizeY;
  
  frameTaskVisualization2DViewer.setSize(x, y);
  frameTaskVisualization2DViewer.setBackground(Color.WHITE);
}
 
Example 2
Project: QN-ACTR-Release   File: QnactrSimulation.java   View Source Code Vote up 6 votes
public static void createAndShowTaskVisualization3DViewerGUI() {
  frameTaskVisualization3DViewer  = new JFrame("TaskVisualization3DViewer");
  frameTaskVisualization3DViewer.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  
  taskVisualization3D = new TaskVisualization3D();
  taskVisualization3D.setOpaque(true); //content panes must be opaque
  frameTaskVisualization3DViewer.setContentPane(taskVisualization3D);

  frameTaskVisualization3DViewer.pack();
  frameTaskVisualization3DViewer.setLocationByPlatform(true);
  frameTaskVisualization3DViewer.setVisible(true);
  
  int x = taskVisualization3DSizeX;
  int y = taskVisualization3DSizeY;
  
  frameTaskVisualization3DViewer.setSize(x, y);
  frameTaskVisualization3DViewer.setBackground(Color.WHITE);
}
 
Example 3
Project: QN-ACTR-Release   File: QnactrSimulation.java   View Source Code Vote up 5 votes
public static void createAndShowEntitiesViewerGUI() {
    
    frameEntitiesViewer = new JFrame("EntitiesViewer");
    frameEntitiesViewer.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

    newContentPaneEntitiesViewer = new EntitiesViewer();
    newContentPaneEntitiesViewer.setOpaque(true); //content panes must be opaque
    frameEntitiesViewer.setContentPane(newContentPaneEntitiesViewer);

    frameEntitiesViewer.pack();
    frameEntitiesViewer.setLocationByPlatform(true);
    frameEntitiesViewer.setVisible(true);
}
 
Example 4
Project: Motion_Profile_Generator   File: Gui2.java   View Source Code Vote up 4 votes
private void aboutPage()
{
	JFrame about = new JFrame();
       about.setLocationByPlatform(true);
       about.setVisible(true);
	about.setTitle("About");
	about.setBounds(100, 100, 600, 400);
	about.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
	about.getContentPane().setLayout(null);
	
	JPanel panel = new JPanel();
	panel.setBounds(0, 0, 584, 361);
	about.getContentPane().add(panel);
	panel.setLayout(null);
	
	JLabel lblMotionProfileGenerator = new JLabel("Motion Profile Generator");
	lblMotionProfileGenerator.setFont(new Font("Arial", Font.PLAIN, 34));
	lblMotionProfileGenerator.setBounds(109, 29, 365, 64);
	panel.add(lblMotionProfileGenerator);
	
	JLabel lblVersion = new JLabel("Version 2.0.0");
	lblVersion.setFont(new Font("Arial", Font.PLAIN, 14));
	lblVersion.setBounds(82, 104, 85, 14);
	panel.add(lblVersion);
	
	JLabel lblThisProductIs = new JLabel("This product is licensed under the MIT license");
	lblThisProductIs.setFont(new Font("Arial", Font.PLAIN, 14));
	lblThisProductIs.setBounds(82, 128, 296, 14);
	panel.add(lblThisProductIs);
	
	JLabel lblDevelopers = new JLabel("Developers");
	lblDevelopers.setFont(new Font("Arial", Font.PLAIN, 14));
	lblDevelopers.setBounds(82, 152, 85, 14);
	panel.add(lblDevelopers);
	
	JLabel lblLukeMammen = new JLabel("Luke Mammen");
	lblLukeMammen.setFont(new Font("Arial", Font.PLAIN, 14));
	lblLukeMammen.setBounds(109, 176, 110, 14);
	panel.add(lblLukeMammen);
	
	JLabel lblBlakeMammen = new JLabel("Blake Mammen");
	lblBlakeMammen.setFont(new Font("Arial", Font.PLAIN, 14));
	lblBlakeMammen.setBounds(109, 200, 110, 14);
	panel.add(lblBlakeMammen);
	
	JLabel lblAcknowedgements = new JLabel("Acknowledgments");
	lblAcknowedgements.setFont(new Font("Arial", Font.PLAIN, 14));
	lblAcknowedgements.setBounds(82, 224, 150, 14);
	panel.add(lblAcknowedgements);
	
	JLabel lblJaci = new JLabel("Jaci for the path generation code");
	lblJaci.setFont(new Font("Arial", Font.PLAIN, 14));
	lblJaci.setBounds(109, 248, 250, 14);
	panel.add(lblJaci);
	
	JLabel lblJH = new JLabel("KHEngineering for the graph code");
	lblJH.setFont(new Font("Arial", Font.PLAIN, 14));
	lblJH.setBounds(109, 272, 250, 14);
	panel.add(lblJH);
}