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

The following are Jave code examples for showing how to use setExtendedState() 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: iTrace-Archive   File: SystemMouseTracker.java   View Source Code Vote up 7 votes
@Override
protected void displayCalibrationStatus(JFrame frame) throws Exception {
      	CalibrationStatusDisplay calibDisplay = 
      			new CalibrationStatusDisplay(frame, calibrationPoints,new java.awt.geom.Point2D.Double[9]);
      	frame.setMinimumSize(new Dimension(600,300));
      	
      	frame.add(calibDisplay);
      	
      	frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      	frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
      	frame.setVisible(true);
      	frame.setTitle("Calibration: "+new Date());
      	Insets insets = frame.getInsets();
      	int width = frame.getSize().width-(insets.left+insets.right);
      	int height = frame.getSize().height-(insets.top+insets.bottom);
      	calibDisplay.windowDimension = new Dimension(width,height);
      	frame.toFront();
      	calibDisplay.repaint();
}
 
Example 2
Project: LP_Proyecto   File: Principal.java   View Source Code Vote up 6 votes
public void VideoLlamada() {
    Webcam webcam = Webcam.getDefault();

    WebcamPanel panel = new WebcamPanel(webcam);
    panel.setFPSDisplayed(true);

    JFrame window = new JFrame("VIDEO CALL");
    window.setTitle("Haciendo videollamada con " + jt_Name_Contacts.getText());

    window.setExtendedState(MAXIMIZED_BOTH);
    panel.setFillArea(true);

    window.add(panel);
    window.pack();
    window.setVisible(true);
}
 
Example 3
Project: ants   File: Menu.java   View Source Code Vote up 6 votes
/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 */
private static void createAndShowGUI() {
	// Create and set up the window.
	final JFrame frame = new JFrame("IBM Slovakia / Fall Fest 2017 / Anthill");
	frame.setExtendedState(frame.getExtendedState() | Frame.MAXIMIZED_BOTH);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	// Set up the content pane.
	// frame.add(new Menu(new InitMenuData(), new GameMenuHandler(), frame),
	// BorderLayout.CENTER);
	final InitMenuData initMenuData = new InitMenuData();
	initDummyData(initMenuData);
	frame.add(new Menu(initMenuData, null, frame), BorderLayout.CENTER);

	// Display the window.
	frame.pack();
	frame.setVisible(true);
}
 
Example 4
Project: TrabalhoCrisParte2   File: ReportUtils.java   View Source Code Vote up 5 votes
/**
 * Cria um JFrame para exibir o relatório representado pelo JasperPrint.
 *
 * @param titulo Título do JFrame.
 * @param print JasperPrint do relatório.
 */
private static void viewReportFrame( String titulo, JasperPrint print ) {
 
    /*
     * Cria um JRViewer para exibir o relatório.
     * Um JRViewer é uma JPanel.
     */
    JRViewer viewer = new JRViewer( print );
 
    // cria o JFrame
    JFrame frameRelatorio = new JFrame( titulo );
 
    // adiciona o JRViewer no JFrame
    frameRelatorio.add( viewer, BorderLayout.CENTER );
 
    // configura o tamanho padrão do JFrame
    frameRelatorio.setSize( 500, 500 );
 
    // maximiza o JFrame para ocupar a tela toda.
    frameRelatorio.setExtendedState( JFrame.MAXIMIZED_BOTH );
 
    // configura a operação padrão quando o JFrame for fechado.
    frameRelatorio.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
 
    // exibe o JFrame
    frameRelatorio.setVisible( true );
 
}
 
Example 5
Project: thornsec-core   File: FullFrame.java   View Source Code Vote up 5 votes
public FullFrame(ThornsecModel model) {
	JTabbedPane jtp = new JTabbedPane();
	for (String network : model.getNetworkLabels()) {
		jtp.add(network, getNetworkPane(model.getNetworkModel(network)));
	}

	JFrame frame = new JFrame("Thornsec");
	frame.setExtendedState(frame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setContentPane(jtp);
	frame.pack();
	frame.setVisible(true);
}
 
Example 6
Project: DSL   File: ASTGraph.java   View Source Code Vote up 5 votes
public static void main(String[] args)
{
    INSTANCE.init();

    JFrame frame = new JFrame();
    frame.getContentPane().add(INSTANCE);
    frame.setExtendedState(JFrame.MAXIMIZED_BOTH); 
    frame.setTitle("JGraphT Adapter to JGraph Demo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
}
 
Example 7
Project: org.alloytools.alloy   File: OurUtil.java   View Source Code Vote up 5 votes
/** Make the frame visible, non-iconized, and focused. */
public static void show(JFrame frame) {
	frame.setVisible(true);
	frame.setExtendedState(frame.getExtendedState() & ~JFrame.ICONIFIED);
	frame.requestFocus();
	frame.toFront();
}
 
Example 8
Project: Tarski   File: OurUtil.java   View Source Code Vote up 5 votes
/** Make the frame visible, non-iconized, and focused. */
public static void show(JFrame frame) {
   frame.setVisible(true);
   frame.setExtendedState(frame.getExtendedState() & ~JFrame.ICONIFIED);
   frame.requestFocus();
   frame.toFront();
}
 
Example 9
Project: chordatlas   File: TweedFrame.java   View Source Code Vote up 4 votes
public TweedFrame() {

		instance = this;

		frame = new JFrame();

		WindowManager.register( frame );

		Dimension d3Dim = new Dimension( 1024, 640 );

		AppSettings settings = new AppSettings( true );

		settings.setWidth( d3Dim.width );
		settings.setHeight( d3Dim.height );
		settings.setSamples( 4 );
		settings.setVSync( true );
		settings.setFrameRate( 60 );

		tweed = new Tweed( this );
		tweed.setSettings( settings );
		tweed.createCanvas();
		JmeCanvasContext ctx = (JmeCanvasContext) tweed.getContext();
		ctx.setSystemListener( tweed );

		canvas = ctx.getCanvas();
		canvas.setPreferredSize( d3Dim );

		frame.setLayout( new BorderLayout() );
		frame.add( buildUI(), BorderLayout.EAST );
		frame.add( canvas, BorderLayout.CENTER );
		frame.setExtendedState( frame.getExtendedState() | JFrame.MAXIMIZED_BOTH );

		frame.addWindowListener( new WindowAdapter() {
			public void windowClosing( WindowEvent e ) {
				TweedSettings.save(true);
				Tweed.deleteScratch();
			};
		} );

		scheduler.scheduleAtFixedRate( new Runnable() {
			@Override
			public void run() {
				TweedSettings.save(true);
			}
		}, 30, 30, TimeUnit.SECONDS );

		scheduler.scheduleAtFixedRate( new Runnable() {
			@Override
			public void run() {
				Vector3d pt = tweed.cursorPosition;
				if ( coordLabel != null && TweedSettings.settings.trans != null) {
					worldLabel.setText( pt == null ? "..." : String.format( "%.4f, %.4f ", 
							pt.x, 
							pt.z) );
					coordLabel.setText( pt == null ? "..." : String.format( "%.4f, %.4f ", 
							pt.x + TweedSettings.settings.trans[0], 
							pt.z + TweedSettings.settings.trans[1]) );
					crsLabel.setText(TweedSettings.settings.gmlCoordSystem);
				}

				JFrame.setDefaultLookAndFeelDecorated( true );

			}
		}, 100, 100, TimeUnit.MILLISECONDS );

		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		frame.pack();
		frame.setVisible( !HEADLESS );

		tweed.startCanvas();
	}
 
Example 10
Project: Logisim   File: WindowMenuItem.java   View Source Code Vote up 4 votes
public void actionPerformed(ActionEvent event) {
	JFrame frame = getJFrame();
	frame.setExtendedState(Frame.NORMAL);
	frame.setVisible(true);
	frame.toFront();
}
 
Example 11
Project: org.alloytools.alloy   File: OurUtil.java   View Source Code Vote up 4 votes
/** This method minimizes the window. */
public static void minimize(JFrame frame) {
	frame.setExtendedState(JFrame.ICONIFIED);
}
 
Example 12
Project: org.alloytools.alloy   File: OurUtil.java   View Source Code Vote up 4 votes
/** This method alternatingly maximizes or restores the window. */
public static void zoom(JFrame frame) {
	int both = JFrame.MAXIMIZED_BOTH;
	frame.setExtendedState((frame.getExtendedState() & both) != both ? both : JFrame.NORMAL);
}
 
Example 13
Project: What-Happened-to-Station-7   File: Station7.java   View Source Code Vote up 4 votes
public static void main(String... args) throws Throwable
{
	JFrame window = new JFrame();
	window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	window.setTitle("What Happened to Station 7");
	window.setMinimumSize(new Dimension(400, 225));
	window.setLayout(new GridBagLayout());
	window.setExtendedState(JFrame.MAXIMIZED_BOTH);

	JFrame opening_text = new JFrame();
	opening_text.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	opening_text.setTitle("This Is What Happened to Station 7");
	JTextArea textField = new JTextArea(
			"The date is 123.5432.1241511    Station 7 is in full operation when suddenly one of the arachnids spot a rather large blue and yellow battle-cruiser barreling towards the aft section of the outer wheel. It suddenly plunges it self deep within the station. The flag suddenly comes within view… Its the swedes on their eternal quest to increase their GDP. They start to scatter but they are not quick enough to survive the army of Carl XVI Gustaf. The Dramatic entrance of the battle-cruiser had created a hull breach and the amount of air in the station was starting to drop; those blast doors can only hold so long….																																																		You Play as the aliens represented by the Purple hexes your objective is to get to the next floor of Staition 7 via the cyan ecape doors the sweds represented by the blue tiles are out to get you it would be in your best intrests to avoid them as they will kill you very quickly, if you notics your color shifting it indicats a change in helth and you will be best adviced to seek out the red health boxes but be carful as they will only heal you so much");
	textField.setLineWrap(true);
	textField.setWrapStyleWord(true);
	opening_text.setMinimumSize(new Dimension(400, 225));
	opening_text.add(textField, BorderLayout.PAGE_START);
	opening_text.setExtendedState(JFrame.MAXIMIZED_BOTH);
	opening_text.setAlwaysOnTop(true);

	JFrame closing_text = new JFrame();
	closing_text.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	closing_text.setTitle("You Have Fell to the Swedes");
	JTextArea text = new JTextArea("You have failed to save your self…. The swedes trudge on obliterating the remaining inhabitants of the station. ");
	text.setLineWrap(true);
	text.setWrapStyleWord(true);
	closing_text.setMinimumSize(new Dimension(400, 225));
	closing_text.add(text, BorderLayout.PAGE_START);
	closing_text.setExtendedState(JFrame.MAXIMIZED_BOTH);

	SoundStuff soundStuff = new SoundStuff();
	soundStuff.dbol();

	Game game = new Game();

	GameRenderer render = new GameRenderer(game);
	render.addListeners(window);
	GridBagConstraints layoutGame = new GridBagConstraints();
	layoutGame.weightx = .9;
	layoutGame.weighty = .9;
	layoutGame.fill = GridBagConstraints.BOTH;
	layoutGame.anchor = GridBagConstraints.NORTH;
	window.add(render, layoutGame);

	GameInfo info = new GameInfo(game);
	info.addListeners();
	GridBagConstraints layoutInfo = new GridBagConstraints();
	layoutInfo.weightx = .1;
	layoutInfo.weighty = .1;
	layoutInfo.fill = GridBagConstraints.BOTH;
	layoutInfo.anchor = GridBagConstraints.NORTH;
	layoutInfo.gridy = 1;
	window.add(info, layoutInfo);

	game.init(render.new UIInterface(), info.new UIInterface());

	closing_text.setVisible(true);
	window.setVisible(true);
	opening_text.setVisible(true);
	Scanner reader = new Scanner(System.in);
	int n = reader.nextInt();
	if (n == 42)
	{
		System.out.print("adadfafd");
		SoundStuff cam = null;
		cam = new SoundStuff();
		cam.CCCP();
		reader.close();
	}
}
 
Example 14
Project: Tarski   File: OurUtil.java   View Source Code Vote up 4 votes
/** This method minimizes the window. */
public static void minimize(JFrame frame) { frame.setExtendedState(JFrame.ICONIFIED); }
 
Example 15
Project: Tarski   File: OurUtil.java   View Source Code Vote up 4 votes
/** This method alternatingly maximizes or restores the window. */
public static void zoom(JFrame frame) {
   int both = JFrame.MAXIMIZED_BOTH;
   frame.setExtendedState((frame.getExtendedState() & both)!=both ? both : JFrame.NORMAL);
}
 
Example 16
Project: iTrace-Archive   File: TobiiTracker.java   View Source Code Vote up 4 votes
protected void displayCalibrationStatus(JFrame frame) throws Exception {
	 double[] pointsNormalized = jniGetCalibration();
	 
	 if (pointsNormalized == null)
		 throw new IOException("Can't get calibration data!");
	 
	 int zeros = 0;
	 for( double ord: pointsNormalized){
		 if( ord <= 0 || ord > 1) zeros++;
	 }
	 ArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();
	 ArrayList<Point2D.Double> invalidpoints = new ArrayList<Point2D.Double>();
	//if( zeros > 0 ) throw new IOException("zeros in points: "+zeros+"/"+pointsNormalized.length);
	 
	 int itemCount = pointsNormalized.length/4;

	 for( int i=0; i < itemCount; i++ ){
		 
		points.add(new Point2D.Double(pointsNormalized[i],pointsNormalized[i+itemCount]));
		points.add(new Point2D.Double(pointsNormalized[(2*itemCount)+i],pointsNormalized[i+(itemCount*3)]));
	 }
	 
	 Rectangle2D.Double rect = new Rectangle2D.Double(0.0,0.0,1.0,1.0);
	 
	 for(Point2D.Double p: points){
		 if( !rect.contains(p) ) invalidpoints.add(p);
	 }
	 
	 for (int i = 0; i < pointsNormalized.length; i++) {
		 if (pointsNormalized[i] < 0.0001) {
			 pointsNormalized[i] = 0.0001;
		 } else if (pointsNormalized[i] > 0.9999) {
			 pointsNormalized[i] = 0.9999;
		 } else {
    		//do nothing
		 }
	 }
    
	 Point2D.Double[] calibrationData = new Point2D.Double[itemCount+1];
	 for (int j = 0; j < itemCount; j+=2) {
		 calibrationData[j] = (new Point2D.Double(pointsNormalized[j],pointsNormalized[itemCount+j]));
		 if(j != itemCount)
			 calibrationData[j+1] = (new Point2D.Double(pointsNormalized[2*itemCount+j],pointsNormalized[3*itemCount+j]));
	 }
	 JFrame calibFrame = frame;
	 CalibrationStatusDisplay calibDisplay = 
			 new CalibrationStatusDisplay(calibFrame,calibrationPoints,calibrationData);
	 
	 calibFrame.add(calibDisplay);
    calibFrame.setUndecorated(false);
    calibFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    calibFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    calibFrame.setMinimumSize(new Dimension(600,300));
    calibFrame.setTitle("Calibration: "+new Date());
    Insets insets = calibFrame.getInsets();
    int width = calibFrame.getSize().width-(insets.left+insets.right);
    int height = calibFrame.getSize().height-(insets.top+insets.bottom);
  		calibDisplay.windowDimension = new Dimension(width,height);
    calibFrame.setVisible(true);
    calibDisplay.repaint();
}
 
Example 17
Project: Tarski   File: OurUtil.java   View Source Code Vote up 4 votes
/** This method minimizes the window. */
public static void minimize(JFrame frame) { frame.setExtendedState(JFrame.ICONIFIED); }
 
Example 18
Project: Tarski   File: OurUtil.java   View Source Code Vote up 4 votes
/** This method alternatingly maximizes or restores the window. */
public static void zoom(JFrame frame) {
   int both = JFrame.MAXIMIZED_BOTH;
   frame.setExtendedState((frame.getExtendedState() & both)!=both ? both : JFrame.NORMAL);
}
 
Example 19
Project: iTrace-Archive   File: EyeXTracker.java   View Source Code Vote up 4 votes
protected void displayCalibrationStatus(JFrame frame) throws Exception {
	 double[] pointsNormalized = jniGetCalibration();
	 
	 if (pointsNormalized == null)
		 throw new IOException("Can't get calibration data!");
	 
	 int zeros = 0;
	 for( double ord: pointsNormalized){
		 if( ord <= 0 || ord > 1) zeros++;
	 }
	 ArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();
	 ArrayList<Point2D.Double> invalidpoints = new ArrayList<Point2D.Double>();
	//if( zeros > 0 ) throw new IOException("zeros in points: "+zeros+"/"+pointsNormalized.length);
	 
	 int itemCount = pointsNormalized.length/4;

	 for( int i=0; i < itemCount; i++ ){
		 
		points.add(new Point2D.Double(pointsNormalized[i],pointsNormalized[i+itemCount]));
		points.add(new Point2D.Double(pointsNormalized[(2*itemCount)+i],pointsNormalized[i+(itemCount*3)]));
	 }
	 
	 Rectangle2D.Double rect = new Rectangle2D.Double(0.0,0.0,1.0,1.0);
	 
	 for(Point2D.Double p: points){
		 if( !rect.contains(p) ) invalidpoints.add(p);
	 }
	 
	 for (int i = 0; i < pointsNormalized.length; i++) {
		 if (pointsNormalized[i] < 0.0001) {
			 pointsNormalized[i] = 0.0001;
		 } else if (pointsNormalized[i] > 0.9999) {
			 pointsNormalized[i] = 0.9999;
		 } else {
    		//do nothing
		 }
	 }
    
	 Point2D.Double[] calibrationData = new Point2D.Double[itemCount+1];
	 for (int j = 0; j < itemCount; j+=2) {
		 calibrationData[j] = (new Point2D.Double(pointsNormalized[j],pointsNormalized[itemCount+j]));
		 if(j != itemCount)
			 calibrationData[j+1] = (new Point2D.Double(pointsNormalized[2*itemCount+j],pointsNormalized[3*itemCount+j]));
	 }
	 JFrame calibFrame = frame;
	 CalibrationStatusDisplay calibDisplay = 
			 new CalibrationStatusDisplay(calibFrame,calibrationPoints,calibrationData);
	 
	 calibFrame.add(calibDisplay);
    calibFrame.setUndecorated(false);
    calibFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    calibFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    calibFrame.setMinimumSize(new Dimension(600,300));
    calibFrame.setTitle("Calibration: "+new Date());
    Insets insets = calibFrame.getInsets();
   	int width = calibFrame.getSize().width-(insets.left+insets.right);
   	int height = calibFrame.getSize().height-(insets.top+insets.bottom);
   	calibDisplay.windowDimension = new Dimension(width,height);
    calibFrame.setVisible(true);
    calibFrame.toFront();
    calibDisplay.repaint();
}
 
Example 20
Project: chordatlas   File: AlignStandalone2d.java   View Source Code Vote up 3 votes
public static JFrame show (String file ) {
	JFrame go = new JFrame("2D align");
	
	go.add( new AlignStandalone2d( file ) );
	go.setExtendedState( go.getExtendedState() | JFrame.MAXIMIZED_BOTH);
	
	go.pack();
	go.setVisible( true );
	
	WindowManager.register( go );
	
	return go;
}