updateColorSelection(newSelection);
if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed"));  } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink"));  } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen"));  } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq"));  } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow"));  } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); }  if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); }  if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); }
   private void jbInit() throws Exception  {      changes = new PropertyChangeSupport(this);      Dimension ps = null;      // fonts      Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();      // define fonts panel      final JPanel fp = new JPanel();      fp.setLayout(new BorderLayout());      JPanel flp = new JPanel();      TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font"));      flp.setBorder(tb);      fontsList = new JComboBox();      String font = getStringProperty("font");      for (int x = 0; x < fonts.length; x++) {         if (fonts[x].getFontName().indexOf('.') < 0)            fontsList.addItem(fonts[x].getFontName());      }      fontsList.setSelectedItem(font);      flp.add(fontsList);      JPanel fsp = new JPanel();      fsp.setLayout(new AlignLayout(2,5,5));      tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel"));      fsp.setBorder(tb);      verticalScale = new JTextField("1.2",5);      horizontalScale = new JTextField("1.0",5);      pointSize = new JTextField("0",5);      if (getStringProperty("fontScaleWidth").length() != 0)         horizontalScale.setText(getStringProperty("fontScaleWidth"));      if (getStringProperty("fontScaleHeight").length() != 0)         verticalScale.setText(getStringProperty("fontScaleHeight"));      if (getStringProperty("fontPointSize").length() != 0)         pointSize.setText(getStringProperty("fontPointSize"));      fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize")));      fsp.add(pointSize);      fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel")));      fsp.add(horizontalScale);      fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel")));      fsp.add(verticalScale);      fp.add(flp,BorderLayout.NORTH);      fp.add(fsp,BorderLayout.SOUTH);      // define colors panel      final JPanel cpp = new JPanel();      cpp.setLayout(new BorderLayout());      JPanel cp = new JPanel();      cp.setLayout(new BorderLayout());      JPanel cschp = new JPanel();      tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema"));      cschp.setBorder(tb);      colorSchemaList = new JComboBox();      loadSchemas(colorSchemaList);      colorSchemaList.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                JComboBox cb = (JComboBox)e.getSource();                Object obj = cb.getSelectedItem();                if (obj instanceof Schema) {                  System.out.println(" we got a schema ");                  colorSchema = (Schema)obj;                }                else {                  colorSchema = null;                }            }        });      cschp.add(colorSchemaList);      tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors"));      cp.setBorder(tb);      colorList = new JComboBox();      colorList.addItem(LangTool.getString("sa.bg"));      colorList.addItem(LangTool.getString("sa.blue"));      colorList.addItem(LangTool.getString("sa.red"));      colorList.addItem(LangTool.getString("sa.pink"));      colorList.addItem(LangTool.getString("sa.green"));      colorList.addItem(LangTool.getString("sa.turq"));      colorList.addItem(LangTool.getString("sa.yellow"));      colorList.addItem(LangTool.getString("sa.white"));      colorList.addItem(LangTool.getString("sa.guiField"));      colorList.addItem(LangTool.getString("sa.cursorColor"));      colorList.addItem(LangTool.getString("sa.columnSep"));      colorList.addItem(LangTool.getString("sa.hexAttrColor"));      jcc = new JColorChooser();      // set the default color for display as that being for back ground      jcc.setColor(getColorProperty("colorBg"));      colorList.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                JComboBox cb = (JComboBox)e.getSource();                String newSelection = (String)cb.getSelectedItem();                updateColorSelection(newSelection);            }        });      cp.add(colorList,BorderLayout.NORTH);      cp.add(jcc,BorderLayout.CENTER);      cpp.add(cschp,BorderLayout.NORTH);      cpp.add(cp,BorderLayout.CENTER);      // define display panel      final JPanel display = new JPanel();      display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS));      // define column separator panel      JPanel csp = new JPanel();      tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs"));      csp.setBorder(tb);      csLine = new JRadioButton(LangTool.getString("sa.csLine"));      csLine.setActionCommand("Line");      csDot = new JRadioButton(LangTool.getString("sa.csDot"));      csDot.setActionCommand("Dot");      csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine"));      csShortLine.setActionCommand("ShortLine");      // Group the radio buttons.      ButtonGroup csGroup = new ButtonGroup();      csGroup.add(csLine);      csGroup.add(csDot);      csGroup.add(csShortLine);      if (getStringProperty("colSeparator").equals("Dot"))         csDot.setSelected(true);      else if (getStringProperty("colSeparator").equals("ShortLine"))         csShortLine.setSelected(true);      else         csLine.setSelected(true);      csp.add(csLine);      csp.add(csDot);      csp.add(csShortLine);      // define show attributs panel      JPanel sap = new JPanel();      sap.setBorder(         BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr")));      saNormal = new JRadioButton(LangTool.getString("sa.showNormal"));      saNormal.setActionCommand("Normal");      JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex"));      saHex.setActionCommand("Hex");      // Group the radio buttons.      ButtonGroup saGroup = new ButtonGroup();      saGroup.add(saNormal);      saGroup.add(saHex);      if (getStringProperty("showAttr").equals("Hex"))         saHex.setSelected(true);      else         saNormal.setSelected(true);      sap.add(saNormal);      sap.add(saHex);      // define gui panel      JPanel cgp = new JPanel();      cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp")));      cgp.setLayout(new AlignLayout(1,5,5));//      cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS));      guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck"));      guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline"));      if (getStringProperty("guiInterface").equals("Yes"))         guiCheck.setSelected(true);      // since this is a new property added then it might not exist in existing      //    profiles and it should be defaulted to yes.      String under = getStringProperty("guiShowUnderline");      if (under.equals("Yes") || under.length() == 0)         guiShowUnderline.setSelected(true);      cgp.add(guiCheck);      cgp.add(guiShowUnderline);      display.add(csp);      display.add(sap);      display.add(cgp);      // define cursor panel      final JPanel cuPanel = new JPanel();      cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS));      // define cursor size panel      JPanel crp = new JPanel();      crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize")));      cFull = new JRadioButton(LangTool.getString("sa.cFull"));      cHalf = new JRadioButton(LangTool.getString("sa.cHalf"));      cLine = new JRadioButton(LangTool.getString("sa.cLine"));      // Group the radio buttons.      ButtonGroup cGroup = new ButtonGroup();      cGroup.add(cFull);      cGroup.add(cHalf);      cGroup.add(cLine);      int cursorSize = 0;      if (getStringProperty("cursorSize").equals("Full"))         cursorSize = 2;      if (getStringProperty("cursorSize").equals("Half"))         cursorSize = 1;      switch (cursorSize) {         case 0:            cLine.setSelected(true);            break;         case 1:            cHalf.setSelected(true);            break;         case 2:            cFull.setSelected(true);            break;      }      crp.add(cFull);      crp.add(cHalf);      crp.add(cLine);      // define cursor ruler panel      JPanel chp = new JPanel();      chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair")));      chNone = new JRadioButton(LangTool.getString("sa.chNone"));      chHorz = new JRadioButton(LangTool.getString("sa.chHorz"));      chVert = new JRadioButton(LangTool.getString("sa.chVert"));      chCross = new JRadioButton(LangTool.getString("sa.chCross"));      // Group the radio buttons.      ButtonGroup chGroup = new ButtonGroup();      chGroup.add(chNone);      chGroup.add(chHorz);      chGroup.add(chVert);      chGroup.add(chCross);      int crossHair = 0;      if (getStringProperty("crossHair").equals("Horz"))         crossHair = 1;      if (getStringProperty("crossHair").equals("Vert"))         crossHair = 2;      if (getStringProperty("crossHair").equals("Both"))         crossHair = 3;      switch (crossHair) {         case 0:            chNone.setSelected(true);            break;         case 1:            chHorz.setSelected(true);            break;         case 2:            chVert.setSelected(true);            break;         case 3:            chCross.setSelected(true);            break;      }      chp.add(chNone);      chp.add(chHorz);      chp.add(chVert);      chp.add(chCross);      // define double click as enter      JPanel rulerFPanel = new JPanel();      rulerFPanel.setBorder(BorderFactory.createTitledBorder(""));      rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed"));      rulerFPanel.add(rulerFixed);      // define double click as enter      JPanel bottOffPanel = new JPanel();      bottOffPanel.setBorder(BorderFactory.createTitledBorder(                                    LangTool.getString("sa.curBottOffset")));      cursorBottOffset = new JTextField(5);      try {         int i = Integer.parseInt(getStringProperty("cursorBottOffset","0"));         cursorBottOffset.setText(Integer.toString(i));      }      catch (NumberFormatException ne) {         cursorBottOffset.setText("0");      }      bottOffPanel.add(cursorBottOffset);      cuPanel.add(crp);      cuPanel.add(chp);      cuPanel.add(rulerFPanel);      cuPanel.add(bottOffPanel);      // define onConnect panel      final JPanel onConnect = new JPanel();      onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS));      // define onConnect macro to run      JPanel ocMacrop = new JPanel();      ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro")));      connectMacro = new JTextField();      connectMacro.setColumns(30);      // check if double click sends enter      connectMacro.setText(getStringProperty("connectMacro"));      ocMacrop.add(connectMacro);      onConnect.add(ocMacrop);      // define mouse panel      final JPanel mouse = new JPanel();      mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS));      // define double click as enter      JPanel dcep = new JPanel();      dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick")));      dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter"));      // check if double click sends enter      dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes"));      dcep.add(dceCheck);      mouse.add(dcep);      // define hotspot panel      final JPanel hotspot = new JPanel();      hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS));      // define hsPanel panel      JPanel hsp = new JPanel();      hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp")));      hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck"));      if (getStringProperty("hotspots").equals("Yes"))         hsCheck.setSelected(true);      hsp.add(hsCheck);      // define assignment panel      JPanel hsap = new JPanel();      hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap")));      hsap.setLayout(new GridLayout(2,2));      JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore"));      JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom"));      hsMore = new JTextField(getStringProperty("hsMore"));      hsBottom = new JTextField(getStringProperty("hsBottom"));      hsap.add(moreLabel);      hsap.add(hsMore);      hsap.add(bottomLabel);      hsap.add(hsBottom);      hotspot.add(hsp);      hotspot.add(hsap);      // define Key Pad panel      final JPanel kp = new JPanel();      kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS));      // define kpPanel panel      JPanel kpp = new JPanel();      kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp")));      kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck"));      if (getStringProperty("keypad").equals("Yes"))         kpCheck.setSelected(true);      kpp.add(kpCheck);      kp.add(kpp);      // define default      final JPanel jp = new JPanel();      jp.add(cpp,BorderLayout.CENTER);      jp.setPreferredSize(cpp.getPreferredSize());      //Create the nodes.      DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName);      createNodes(top);      //Create a tree that allows one selection at a time.      final JTree tree = new JTree(top);      tree.getSelectionModel().setSelectionMode             (TreeSelectionModel.SINGLE_TREE_SELECTION);      //Listen for when the selection changes.      tree.addTreeSelectionListener(new TreeSelectionListener() {         public void valueChanged(TreeSelectionEvent e) {            DefaultMutableTreeNode node = (DefaultMutableTreeNode)                                tree.getLastSelectedPathComponent();            if (node == null)               return;            Object nodeInfo = node.getUserObject();            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) {               jp.removeAll();               jp.add(fp,BorderLayout.NORTH);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) {               jp.removeAll();               jp.add(cpp,BorderLayout.CENTER);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) {               jp.removeAll();               jp.add(display,BorderLayout.NORTH);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) {               jp.removeAll();               jp.add(cuPanel,BorderLayout.CENTER);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) {               jp.removeAll();               jp.add(onConnect,BorderLayout.CENTER);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) {               jp.removeAll();               jp.add(mouse,BorderLayout.CENTER);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) {               jp.removeAll();               jp.add(hotspot,BorderLayout.CENTER);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }            if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) {               jp.removeAll();               jp.add(kp,BorderLayout.CENTER);               jp.setPreferredSize(cpp.getPreferredSize());               jp.validate();               jpm.repaint();            }         }      });      // define tree selection panel      JPanel jsp = new JPanel();      jsp.setBackground(Color.white);      jsp.add(tree);      jpm.add(jp,BorderLayout.EAST);      jpm.add(jsp,BorderLayout.WEST);   }