Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

50
LINES

< > BotCompany Repo | #1000274 // JavaX IDE (v2 - does something!)

JavaX source code - run with: x30.jar

1  
!592 // auto-import
2  
!614 // actionListener {
3  
!1000271 // standard classes (LetterLayout, CenteredLine)
4  
!1000272 // class x9
5  
6  
import java.awt.*;
7  
8  
public class main {
9  
  public static void main(String[] args) {
10  
    JFrame frame = new JFrame("JavaX IDE!");
11  
    
12  
    final JTextArea textArea = new JTextArea();
13  
    JButton btnGo = new JButton("Go!");
14  
    btnGo.addActionListener(actionListener {
15  
      try {
16  
        File ioBaseDir = new File(".");
17  
        File src = x9.TempDirMaker_make();
18  
        x9.saveTextFile(new File(src, "main.java").getPath(), textArea.getText());
19  
        x9.javax4(src.getPath(), ioBaseDir, false, false);
20  
      } catch (Throwable e) {
21  
        popupError(e);
22  
      }
23  
    });
24  
25  
    JPanel panel = new JPanel(new LetterLayout("T", "T", "B").setBorder(10));
26  
    panel.add("T", new JScrollPane(textArea));
27  
    panel.add("B", new CenteredLine(btnGo));
28  
    frame.add(panel);
29  
    
30  
    frame.setBounds(100, 100, 500, 400);
31  
    frame.setVisible(true);
32  
    exitOnFrameClose(frame);
33  
  }
34  
  
35  
  static void exitOnFrameClose(JFrame frame) {
36  
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
37  
  }
38  
  
39  
  static void popupError(final Throwable throwable) {
40  
    throwable.printStackTrace(); // print stack trace to console for the experts
41  
    SwingUtilities.invokeLater(new Runnable() {
42  
      public void run() {
43  
        String text = throwable.toString();
44  
        //text = cutPrefix(text, "java.lang.RuntimeException: ");
45  
        JOptionPane.showMessageDialog(null, text);
46  
      }
47  
    });
48  
  }
49  
50  
}

Author comment

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

Comments [hide]

ID Author/Program Comment Date
481 #1000610 (pitcher) 2015-08-18 00:07:07
480 #1000604 (pitcher) 2015-08-18 00:07:22
59 stefan Run with "java x9 1000274" (tinybrain.de/x9.class) 2015-05-11 17:29:32

add comment

Snippet ID: #1000274
Snippet name: JavaX IDE (v2 - does something!)
Eternal ID of this version: #1000274/1
Text MD5: 4e285f39680ba7fcb68ade1cb8142a31
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-05-10 18:10:04
Source code size: 1555 bytes / 50 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 922 / 751
Referenced in: [show references]