Пример #1
0
  public CookiePanel() {
    try {
      jbInit();
    } catch (Exception e) {
      e.printStackTrace();
    }
    buttonGroupDefault.add(jRadioButtonDefaultAccept);
    buttonGroupDefault.add(jRadioButtonDefaultAsk);
    buttonGroupDefault.add(jRadioButtonDefaultReject);
    buttonGroupDomain.add(jRadioButtonDomainAccept);
    buttonGroupDomain.add(jRadioButtonDomainAsk);
    buttonGroupDomain.add(jRadioButtonDomainReject);

    Object[][] cells = {
      {"java.sun.com", "accept"},
      {"amazon.com", "ask"},
      {"evil.hacker.org", "deny"},
      {"microsoft.com", "deny"},
      {"ibm.com", "ask"},
      {"oracle.com", "accept"},
      {"netscape.com", "accept"},
      {"borland.com", "accept"},
      {"rsasecurity.com", "accept"},
      {"linux.org", "accept"},
      {"redhat.com", "accept"},
      {"linuxjournal.com", "accept"},
      {"bea.com", "accept"},
      {"sick.perverts.org", "deny"}
    };
    String[] columnNames = {"Domain", "Policy"};
    JTable table = new JTable(cells, columnNames);
    JScrollPane scrollpane = new JScrollPane(table);
    table.setPreferredScrollableViewportSize(new Dimension(28, 10));
    jPanelDomainSpecific.add(scrollpane);
  }
Пример #2
0
  public AccountPanel() {
    try {
      jbInit();
    } catch (Exception e) {
      e.printStackTrace();
    }

    usermodel.addUser(new User("karl", "Karl Marx", ("rabid#communist").toCharArray()));
    usermodel.addUser(new User("vlad", "Vladimir Lenin", ("looney").toCharArray()));
    table = new JTable(usermodel);
    table.setPreferredScrollableViewportSize(new Dimension(28, 8));
    JScrollPane scrollpane = new JScrollPane(table);
    jPanelUsers.add(scrollpane);
  }