File: arduinopc.java

package info (click to toggle)
arduino 1%3A1.0.1%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 22,476 kB
  • sloc: java: 56,088; cpp: 10,050; ansic: 9,904; makefile: 1,721; xml: 468; perl: 198; sh: 153; python: 62
file content (72 lines) | stat: -rw-r--r-- 2,297 bytes parent folder | download
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//javac Example.java
//jar cfe Example.jar Example *.class
//java -jar Example.jar

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.JLabel;
import javax.swing.SwingUtilities;


public class arduinopc extends JFrame {

    public arduinopc() {
        initUI();
    }

    public final void initUI() {

       JPanel panel = new JPanel();
       getContentPane().add(panel);

//       panel.setLayout(null);

       JButton ignoreButton = new JButton("Ignore");
       //ignoreButton.setBounds(50, 60, 80, 30);
       ignoreButton.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent event) {
               System.exit(0);
          }
       });

       JButton addButton = new JButton("Add");
       //addButton.setBounds(150, 60, 80, 30);
       addButton.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent event) {
               System.exit(1);
          }
       });

        //JLabel label = new JLabel("<html>You need to be a member of the \"dailout\"<br>group to upload code to an Arduino<br>microcontroller over the USB or<br>serial ports.<br></html>");
	//label.setBounds(10,10,300,100);
        panel.add(new JLabel("<html>You need to be added to the \"dialout\"<br>group to upload code to an Arduino<br>microcontroller over the USB or<br>serial ports.<br><br>Click \"Add\" below to be added.<br><br>You must log out and log in again<br>before any group changes<br>will take effect.</html>", JLabel.CENTER));
        //label.setFont(new Font("Georgia", Font.PLAIN, 14));
       //label.setForeground(new Color(50, 50, 25));
//label.setOpaque(true);


       //panel.add(label);//, BorderLayout.CENTER);
       panel.add(ignoreButton);
       panel.add(addButton);



       setTitle("Arduino Permission Checker");
       setSize(300, 250);
       setLocationRelativeTo(null);
       setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                arduinopc ex = new arduinopc();
                ex.setVisible(true);
            }
        });
    }
}