Advertisement
Guest User

Untitled

a guest
Nov 11th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. JComponent c = getDisclosedComponent(newValue);
  2.         GridBagLayout layout = (GridBagLayout) getLayout();
  3.         GridBagConstraints gbc = new GridBagConstraints();
  4.         if (c != null) {
  5.             gbc = new GridBagConstraints();
  6.             gbc.gridx = 1;
  7.             gbc.weightx = 1d;
  8.             gbc.weighty = 1d;
  9.             gbc.fill = GridBagConstraints.BOTH;
  10.             gbc.anchor = GridBagConstraints.WEST;
  11.             add(c, gbc);  
  12.             gbc = new GridBagConstraints();
  13.             gbc.gridx = 0;
  14.             gbc.weightx = 0d;
  15.             gbc.insets = new Insets(0, 1, 0, 1);
  16.             gbc.weighty = 1d;
  17.             gbc.fill = GridBagConstraints.NONE;
  18.             gbc.anchor = GridBagConstraints.SOUTHWEST;
  19.             add(disclosureButton, gbc);
  20.         } else {
  21.             gbc = new GridBagConstraints();
  22.             gbc.gridx = 1;
  23.             gbc.weightx = 1d;
  24.             gbc.weighty = 1d;
  25.             gbc.fill = GridBagConstraints.NONE;
  26.             gbc.anchor = GridBagConstraints.SOUTHWEST;
  27.             gbc.insets = new Insets(0, 1, 0, 1);
  28.             add(disclosureButton, gbc);
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement