Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RSyntaxTextArea textArea = new RSyntaxTextArea(50, 150);
- textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
- textArea.setCodeFoldingEnabled(true);
- RTextScrollPane sp = new RTextScrollPane(textArea);
- cp.setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
- c.fill = GridBagConstraints.HORIZONTAL;
- c.gridx = 0;
- c.gridy = 0;
- cp.add(createToolbar(), c);
- c.gridx = 0;
- c.gridy = 1;
- c.ipadx = 90;
- c.fill = GridBagConstraints.BOTH;
- cp.add(createTree(), c);
- c.gridx = 1;
- c.gridy = 1;
- c.fill = GridBagConstraints.HORIZONTAL;
- cp.add(sp, c);
- ...
- private JToolBar createToolbar() {
- JToolBar tb = new JToolBar("Toolbar", JToolBar.HORIZONTAL);
- JButton ob = new JButton(new ImageIcon("..."));
- tb.add(ob);
- tb.setFloatable(false);
- tb.setRollover(true);
- return tb;
- }
- ...
- private JTree createTree() {
- DefaultMutableTreeNode top = new DefaultMutableTreeNode("Projects");
- JTree tree = new JTree(top);
- DefaultMutableTreeNode test = new DefaultMutableTreeNode("I'm a test!");
- top.add(test);
- return tree;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement