language: C++ 4.7.2 (gcc-4.7.2)
date: 190 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.enernoc;
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class Main extends JFrame{
    public Main(){
                initUI();
}
public final void initUI() {
 
    JPanel panel = new JPanel();
    getContentPane().add(panel);
 
    panel.setLayout(null);
 
    JButton quitButton = new JButton("Quit--omgwtfbbqsaucelolz");
    quitButton.setBounds(50, 60, 80, 30);
    quitButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            System.exit(0);
       }
    });
 
    panel.add(quitButton);
 
    setTitle("Quit button");
    setSize(300, 200);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
 }
        public static void main(String[] args){
                SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Main ex = new Main();
                ex.setVisible(true);
            }
        });
                
        }
}
 
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’