Example #1
0
 /**
  * used to manage the connection icons to signify connection and secure status
  *
  * @param b true if connected
  */
 public void setConnected(boolean b) {
   if (b) {
     conIcon.setIcon(conYes);
     conIcon.setToolTipText("Connected");
     secIcon.setIcon(secYes);
     secIcon.setToolTipText("Secure Connection");
     butChannel.setEnabled(true);
   } else {
     conIcon.setIcon(conNo);
     conIcon.setToolTipText("Not Connected");
     secIcon.setIcon(secNo);
     secIcon.setToolTipText("Connection not Secured");
     butChannel.setEnabled(false);
     butCreate.setEnabled(false);
     butInvite.setEnabled(false);
   }
 }
Example #2
0
  private void insertParameter(ConfigParamDescr descr, String format, int pos) {
    try {
      StyledDocument doc = (StyledDocument) editorPane.getDocument();

      // The component must first be wrapped in a style
      Style style = doc.addStyle("Parameter-" + numParameters, null);
      JLabel label = new JLabel(descr.getDisplayName());
      label.setAlignmentY(0.8f); // make sure we line up
      label.setFont(new Font("Helvetica", Font.PLAIN, 14));
      label.setForeground(Color.BLUE);
      label.setName(descr.getKey());
      label.setToolTipText("key: " + descr.getKey() + "    format: " + format);
      StyleConstants.setComponent(style, label);
      doc.insertString(pos, format, style);
      numParameters++;
    } catch (BadLocationException e) {
    }
  }