예제 #1
0
  public NetworkPanel() {
    super(new GridBagLayout());

    DefaultTableModel model = new DefaultTableModel();
    model.addColumn("Received");
    model.addColumn("Sent");

    networkTable =
        new JZebraTable(model) {

          @Override
          public boolean isCellEditable(int rowIndex, int colIndex) {
            return false;
          }
        };
    networkTable.setShowHorizontalLines(true);
    networkTable.setShowVerticalLines(true);

    this.add(
        new JScrollPane(
            networkTable,
            ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED),
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(5, 5, 5, 5),
            5,
            5));
  }