fork download
  1. package com.enernoc;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5.  
  6. import javax.swing.JButton;
  7. import javax.swing.JFrame;
  8. import javax.swing.JPanel;
  9. import javax.swing.SwingUtilities;
  10. public class Main extends JFrame{
  11. public Main(){
  12. initUI();
  13. }
  14. public final void initUI() {
  15.  
  16. JPanel panel = new JPanel();
  17. getContentPane().add(panel);
  18.  
  19. panel.setLayout(null);
  20.  
  21. JButton quitButton = new JButton("Quit--omgwtfbbqsaucelolz");
  22. quitButton.setBounds(50, 60, 80, 30);
  23. quitButton.addActionListener(new ActionListener() {
  24. public void actionPerformed(ActionEvent event) {
  25. System.exit(0);
  26. }
  27. });
  28.  
  29. panel.add(quitButton);
  30.  
  31. setTitle("Quit button");
  32. setSize(300, 200);
  33. setLocationRelativeTo(null);
  34. setDefaultCloseOperation(EXIT_ON_CLOSE);
  35. }
  36. public static void main(String[] args){
  37. SwingUtilities.invokeLater(new Runnable() {
  38. public void run() {
  39. Main ex = new Main();
  40. ex.setVisible(true);
  41. }
  42. });
  43.  
  44. }
  45. }
  46.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1: error: ‘package’ does not name a type
prog.cpp:3: error: ‘import’ does not name a type
prog.cpp:4: error: ‘import’ does not name a type
prog.cpp:6: error: ‘import’ does not name a type
prog.cpp:7: error: ‘import’ does not name a type
prog.cpp:8: error: ‘import’ does not name a type
prog.cpp:9: error: ‘import’ does not name a type
prog.cpp:10: error: expected unqualified-id before ‘public’
stdout
Standard output is empty