Guest User

Untitled

a guest
Nov 21st, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. titlePanel = new JPanel();
  2. titlePanel.setBackground(new Color(192, 192, 192));
  3. titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.X_AXIS));
  4. titlePanel.setMaximumSize(new Dimension(8000, 20));
  5. titlePanel.setMinimumSize(new Dimension(100, 20));
  6.  
  7. //Create table data
  8. String[] columnNames = new String[1];
  9. columnNames[0] = "";
  10.  
  11. String[][] data = new String[1][];
  12. data[0] = new String[2];
  13. data[0][0] = " blabla";
  14. data[0][1] = "";
  15.  
  16. //Create gap
  17. int sum = depth * 20;
  18. JPanel blankPanel = new JPanel();
  19. blankPanel.setBackground(new Color(192, 192, 192));
  20. blankPanel.setMinimumSize(new Dimension(sum, 20));
  21. blankPanel.setMaximumSize(new Dimension(sum, 20));
  22. titlePanel.add(blankPanel);
  23.  
  24. //Create button
  25. openCloseButton = new JToggleButton();
  26. openCloseButton.setMinimumSize(new Dimension(15, 15));
  27. openCloseButton.setMaximumSize(new Dimension(15, 15));
  28. openCloseButton.setIcon(EditorTreePropertiesPanel.PLUS_ICON);
  29. openCloseButton.setSelectedIcon(EditorTreePropertiesPanel.MINUS_ICON);
  30. openCloseButton.setContentAreaFilled(false);
  31. openCloseButton.setOpaque(false);
  32. openCloseButton.setFocusPainted(false);
  33. titlePanel.add(openCloseButton);
  34.  
  35. JTable table = new JTable(data, columnNames)
  36. {
  37. @Override
  38. public boolean isCellEditable(int row, int column)
  39. {
  40. return false;
  41. };
  42. };
  43. table.getTableHeader().setVisible(false);
  44. table.setMinimumSize(new Dimension(200, 16));
  45. table.setMaximumSize(new Dimension(20000, 16));
  46. titlePanel.add(table);
Add Comment
Please, Sign In to add comment