fork download
  1. import javax.swing.JFrame;
  2. import javax.swing.JLabel;
  3. import javax.swing.WindowConstants;
  4.  
  5. public class YoDude extends JFrame {
  6.  
  7. public YoDude(String message) {
  8. super("Yo Dude");
  9. getContentPane().add(new JLabel(message));
  10. setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  11. pack();
  12. }
  13.  
  14. public static void main(String[] args) {
  15. YoDude yoDude = new YoDude(" What's up? ");
  16. yoDude.setLocation(300, 300);
  17. yoDude.show();
  18. }
  19. }
  20.  
Runtime error #stdin #stdout 0.27s 213120KB
stdin
Standard input is empty
stdout
Standard output is empty