1 | !592 // auto-import |
2 | !614 // actionListener { |
3 | !619 // standard classes (LetterLayout, CenteredLine) |
4 | !1000280 // class x12 |
5 | |
6 | import java.awt.*; |
7 | import java.util.List; |
8 | |
9 | public class main { |
10 | public static void main(String[] args) { |
11 | JFrame frame = new JFrame("JavaX IDE!"); |
12 | |
13 | final JTextArea textArea = new JTextArea(); |
14 | JButton btnGo = new JButton("Go!"); |
15 | btnGo.addActionListener(actionListener { |
16 | try { |
17 | File ioBaseDir = new File("."); |
18 | File src = x12.TempDirMaker_make(); |
19 | x12.saveTextFile(new File(src, "main.java").getPath(), textArea.getText()); |
20 | x12.javax4(src.getPath(), ioBaseDir, false, false); |
21 | } catch (Throwable e) { |
22 | popupError(e); |
23 | } |
24 | }); |
25 | |
26 | JPanel panel = new JPanel(new LetterLayout("T", "T", "B").setBorder(10)); |
27 | panel.add("T", new JScrollPane(textArea)); |
28 | panel.add("B", new CenteredLine(btnGo)); |
29 | frame.add(panel); |
30 | |
31 | frame.setBounds(100, 100, 500, 400); |
32 | frame.setVisible(true); |
33 | exitOnFrameClose(frame); |
34 | } |
35 | |
36 | static void exitOnFrameClose(JFrame frame) { |
37 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
38 | } |
39 | |
40 | static void popupError(final Throwable throwable) { |
41 | throwable.printStackTrace(); // print stack trace to console for the experts |
42 | SwingUtilities.invokeLater(new Runnable() { |
43 | public void run() { |
44 | String text = throwable.toString(); |
45 | //text = cutPrefix(text, "java.lang.RuntimeException: "); |
46 | JOptionPane.showMessageDialog(null, text); |
47 | } |
48 | }); |
49 | } |
50 | |
51 | } |
Began life as a copy of #613
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1000281 |
Snippet name: | JavaX IDE (developing, upgraded to X12) |
Eternal ID of this version: | #1000281/1 |
Text MD5: | 8307d080e936f615df1f9474b7748364 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-05-21 18:14:17 |
Source code size: | 1579 bytes / 51 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 796 / 626 |
Referenced in: | [show references] |