Pack() Example- Output Screens

  Return to the Java Programming Corner.


pack() Example (Screen 1)
Screen 1: Example of using the pack() method to automatically size the Window

setSize() Example (Screen 2)
Screen 2: Explicitly using the setSize() method to size the Window

setSize() Example (Screen 2)
Screen 3: Not using setSize() or pack() will create Window of Height / Width = 0