Debian Codegraph @

debian/permission-checker/arduinopc.java

raw symbols SCIP
1 /*
2 arduino permission checker prompts the user about required device permissions
3 Copyright (C) 2012 Scott Howard <[email protected]>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 //javac Example.java
20 //jar cfe Example.jar Example *.class
21 //java -jar Example.jar
22
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25
26 import javax.swing.JButton;
27 import javax.swing.JFrame;
28 import javax.swing.JPanel;
29 import javax.swing.JLabel;
30 import javax.swing.SwingUtilities;
31
32
33 public class arduinopc extends JFrame {
34
35 public arduinopc() {
36 initUI();
37 }
38
39 public final void initUI() {
40
41 JPanel panel = new JPanel();
42 getContentPane().add(panel);
43
44 // panel.setLayout(null);
45
46 JButton ignoreButton = new JButton("Ignore");
47 //ignoreButton.setBounds(50, 60, 80, 30);
48 ignoreButton.addActionListener(new ActionListener() {
49 public void actionPerformed(ActionEvent event) {
50 System.exit(0);
51 }
52 });
53
54 JButton addButton = new JButton("Add");
55 //addButton.setBounds(150, 60, 80, 30);
56 addButton.addActionListener(new ActionListener() {
57 public void actionPerformed(ActionEvent event) {
58 System.exit(1);
59 }
60 });
61
62 //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>");
63 //label.setBounds(10,10,300,100);
64 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));
65 //label.setFont(new Font("Georgia", Font.PLAIN, 14));
66 //label.setForeground(new Color(50, 50, 25));
67 //label.setOpaque(true);
68
69
70 //panel.add(label);//, BorderLayout.CENTER);
71 panel.add(ignoreButton);
72 panel.add(addButton);
73
74
75
76 setTitle("Arduino Permission Checker");
77 setSize(300, 250);
78 setLocationRelativeTo(null);
79 setDefaultCloseOperation(EXIT_ON_CLOSE);
80 }
81
82 public static void main(String[] args) {
83 SwingUtilities.invokeLater(new Runnable() {
84 public void run() {
85 arduinopc ex = new arduinopc();
86 ex.setVisible(true);
87 }
88 });
89 }
90 }