Search
 
SCRIPT & CODE EXAMPLE
 

C

jframe mittig positionieren

public class MyFrame {

   public MyFrame(String title) {
      JFrame frame = new JFrame(title);
      frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      int windowWidth = 800; //Breite des Programmfensters in Pixel
      int windowHeight = 600; //Höhe des Programmfensters in Pixel
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); //Bildschirmdimensionen in Pixeln holen
      frame.setBounds((screenSize.width-windowWidth)/2, (screenSize.height-windowHeight)/2, windowWidth, windowHeight);
      frame.setVisible(true);
   }

   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
          public void run() {
              new MyFrame("Byte-Welt.net");
          }
      });
   }
}
Comment

PREVIOUS NEXT
Code Example
C :: how can i show ant text by onclick 
C :: mongodb delete all documents 
Dart :: flutter keyboard causes overflow 
Dart :: flutter remove debug badge 
Dart :: flutter validate email 
Dart :: flutter text form field change underline color 
Dart :: flutter text right overflowed 
Dart :: flutter format currency fcfa 
Dart :: flutter textinput number 
Dart :: flutter random pick in list 
Dart :: dart round to 2 decimals 
Dart :: Flutter: Setting the height of the AppBar 
Dart :: dart ceil 
Dart :: flutter auto height container 
Dart :: borderradius.only flutter 
Dart :: into to char dart 
Dart :: dart inset all 
Dart :: remove file extension from path dart 
Dart :: dart list map index 
Dart :: flutter display widget based on device orientation 
Dart :: linearprogressindicator flutter 
Dart :: dart utf-16 
Dart :: flutter main.dart 
Dart :: flutter performance timer 
Dart :: delay in flutter 
Dart :: random in flutter int 
Dart :: Counting no of word in javascript string 
Dart :: git revert to specific commit id and push 
Dart :: flutter snackbar 
Dart :: print string char by char in dart 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =