コード例 #1
0
 public Component getControls() {
   if (controls == null) {
     Box b = Box.createVerticalBox();
     b.add(new JLabel(Resources.getString("Notes.invisible"))); // $NON-NLS-1$
     text = new TextConfigurer(null, null);
     b.add(text.getControls());
     controls = b;
   }
   return controls;
 }
コード例 #2
0
ファイル: RoomTree.java プロジェクト: marcpawl/vassal
  public RoomTree() {
    setRootVisible(false);
    setShowsRootHandles(true);
    root = new DefaultMutableTreeNode(Resources.getString("Chat.server")); // $NON-NLS-1$
    model =
        new DefaultTreeModel(root) {
          private static final long serialVersionUID = 1L;

          public boolean isLeaf(Object node) {
            return ((DefaultMutableTreeNode) node).getUserObject() instanceof Player;
          }
        };
    setModel(model);
    setCellRenderer(new RoomTreeRenderer());
  }