Code example for TitledBorder

0
        //---- label2 ---- 
        label2.setText("NetCDF Format:"); 
 
        //======== panel1 ======== 
        { 
          panel1.setBorder(new TitledBorder(null, "netCDF4 options", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION)); 
          panel1.setLayout(new GridBagLayout()); 
          ((GridBagLayout)panel1.getLayout()).columnWidths = new int[] {0, 0, 0}; 
          ((GridBagLayout)panel1.getLayout()).rowHeights = new int[] {0, 0, 0, 0}; 
          ((GridBagLayout)panel1.getLayout()).columnWeights = new double[] {0.0, 1.0, 1.0E-4}; 
          ((GridBagLayout)panel1.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4}; 
 
          //---- label3 ---- 
          label3.setText("Chunking:"); 
          panel1.add(label3, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, 
            new Insets(0, 0, 0, 0), 0, 0)); 
 
          //---- chunking ---- 
          chunking.addItemListener(new ItemListener() {