Java | Jframe | Generate with anchor to the right of the screen

0

Good afternoon.

I want to generate a main jframe that when instantiated is anchored, automatically, to the right of my display, it is a desktop aplication.

I want that when it appears it comes out of that side so automatic. [With its high and automatic anchor.] link

Thanks in advance for your help.

    
asked by José Herrera Avila 14.07.2017 в 04:41
source

1 answer

0

They can serve you basically 3 lines:

Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize();
setSize( 300, (int) pantalla.getHeight() );
setLocation( (int) pantalla.getWidth() - getWidth(), 0 );

Just opened ( Yosemite & Mint )

    
answered by 14.07.2017 / 19:59
source