예제 #1
0
  public void update(Observable o, Object arg) {
    //		notificationManager.load()

    NotificationsInterface ni = (NotificationsInterface) o;
    //		System.out.println("dimensione notifica in update:"+ni.getNotifications().size()+"|");
    Notification n = ni.getLast();
    if (n != null) {
      //
      //	System.out.println("code:"+n.getCode()+"|id:"+n.getId()+"|descr:"+n.getDescription()+"|");
      JPanel p = new JPanel(true);
      p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
      JLabel jtf = new JLabel(n.getCreationTime().toString());
      jtf.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));
      jtf.setForeground(new Color(88, 88, 88));
      jtf.enableInputMethods(false);
      JLabel jta = new JLabel(n.getDescription());
      jta.setForeground(new Color(11, 11, 11));
      jta.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));
      jta.enableInputMethods(false);
      p.add(jtf);
      p.add(jta);
      p.setVisible(true);
      add(p);
      repaint();
    }
  }
예제 #2
0
 @Override
 public Component getTableCellRendererComponent(
     JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
   label.setText("");
   label.setBorder(PropertyEditorTable.BORDER_RENDER);
   label.setForeground(table.getForeground());
   label.setBackground(table.getBackground());
   label.setFont(table.getFont().deriveFont(Font.PLAIN));
   if (isActivated() && (value instanceof SignalData)) {
     SignalData st = (SignalData) value;
     switch (column) {
       case COLUMN_SIGNAL:
         label.setText(st.name);
         label.setForeground(getTypeColor(st.type));
         break;
       case COLUMN_STATE:
         label.setText(st.value.toString());
         if (st.excited) {
           label.setFont(table.getFont().deriveFont(Font.BOLD));
         }
         break;
       default:
         break;
     }
   }
   return label;
 }
예제 #3
0
  public void refresh() {

    int walk = getBattleArmor().getOriginalWalkMP();
    int jump = getBattleArmor().getOriginalJumpMP();
    float maxKilos = getBattleArmor().getTrooperWeight();
    float currentKilos;
    int bv = getBattleArmor().calculateBattleValue();
    int currentCost = (int) Math.round(getBattleArmor().getCost(false));

    testBA = new TestBattleArmor(getBattleArmor(), entityVerifier.baOption, null);
    currentKilos = testBA.calculateWeight(BattleArmor.LOC_SQUAD);
    currentKilos += UnitUtil.getUnallocatedAmmoTonnage(getBattleArmor());

    tons.setText("Suit Weight: " + String.format("%1$.3f", currentKilos) + "/" + maxKilos);
    tons.setToolTipText(
        "This represents the weight of all squad-level "
            + "equipment, it does not count individual equipment");
    if (currentKilos > maxKilos) {
      tons.setForeground(Color.red);
    } else {
      tons.setForeground(Color.black);
    }

    bvLabel.setText("BV: " + bv);
    bvLabel.setToolTipText("BV 2.0");

    move.setText("Movement: " + walk + "/" + jump);
    move.setToolTipText("Walk/Jump MP");

    cost.setText("Squad Cost: " + formatter.format(currentCost) + " C-bills");
  }
예제 #4
0
 @Override
 public Component getListCellRendererComponent(
     JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus) {
   label.setText(Objects.toString(value, ""));
   this.list = list;
   this.index = index;
   if (isSelected) {
     setBackground(list.getSelectionBackground());
     label.setForeground(list.getSelectionForeground());
   } else {
     setBackground(index % 2 == 0 ? EVEN_COLOR : list.getBackground());
     label.setForeground(list.getForeground());
   }
   MutableComboBoxModel m = (MutableComboBoxModel) list.getModel();
   if (index < 0 || m.getSize() - 1 <= 0) {
     setOpaque(false);
     deleteButton.setVisible(false);
     label.setForeground(list.getForeground());
   } else {
     boolean f = index == rolloverIndex;
     setOpaque(true);
     deleteButton.setVisible(true);
     deleteButton.getModel().setRollover(f);
     deleteButton.setForeground(f ? Color.WHITE : list.getForeground());
   }
   return this;
 }
예제 #5
0
 public LoginDialog() {
   lblHost.setFont(font);
   lblHost.setForeground(new Color(51, 51, 102));
   lblWashU.setFont(font);
   lblWashU.setForeground(Color.WHITE);
   panel.add(lblHost);
   panel.add(loginPanel);
   panel.add(lblWashU);
   panel.setPreferredSize(new Dimension(400, 500));
   panel.setBorder(new BevelBorder(BevelBorder.RAISED));
   panel.setBackground(new Color(51, 51, 102));
   loginPanel.btnOK.addActionListener(this);
   loginPanel.txtUser.addKeyListener(this);
   loginPanel.txtPass.addKeyListener(this);
   loginPanel.lblGuestUserIcon.addMouseListener(customMouseListener);
   add(panel);
   buildLayout();
   setUndecorated(true);
   pack();
   setAlwaysOnTop(true);
   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
   Dimension windowSize = this.getPreferredSize();
   setBounds(
       (screenSize.width - windowSize.width) / 2,
       (screenSize.height - windowSize.height) / 2,
       windowSize.width,
       windowSize.height);
   setVisible(false);
 }
예제 #6
0
 @Override
 public Component getListCellRendererComponent(
     JList<? extends LogRecord> list,
     LogRecord record,
     int index,
     boolean isSelected,
     boolean cellHasFocus) {
   JLabel label =
       (JLabel)
           defaultRenderer.getListCellRendererComponent(
               list, record, index, isSelected, cellHasFocus);
   String formattedText = getFormattedText(record);
   label.setText(formattedText);
   if (!isSelected) {
     if (record.getFormattedMessage().startsWith("---")
         && record.getFormattedMessage().endsWith("---")) {
       label.setForeground(Color.GRAY);
     } else if (record.getLogLevel() == LogLevel.ERROR) {
       label.setForeground(new Color(220, 0, 0));
     } else if (record.getLogLevel() == LogLevel.WARN) {
       label.setForeground(new Color(255, 135, 0));
     } else if (record.getLogLevel() == LogLevel.DEBUG) {
       label.setForeground(Color.LIGHT_GRAY);
     }
   }
   label.setBorder(border);
   return label;
 }
  public Welcome() {
    c.setLayout(null);

    c.add(welcome);
    welcome.setBounds(250, 100, 600, 50);
    welcome.setFont(font1);
    welcome.setForeground(Color.black);

    c.add(hotel);
    hotel.setBounds(350, 170, 700, 50);
    hotel.setFont(font2);
    hotel.setForeground(Color.black);

    c.add(check);
    check.setBounds(450, 350, 250, 50);
    check.addActionListener(this);

    c.add(order);
    order.setBounds(150, 350, 250, 50);
    order.addActionListener(this);

    c.add(bill);
    bill.setBounds(750, 350, 250, 50);
    bill.addActionListener(this);

    c.add(exit);
    exit.setBounds(40, 600, 130, 20);
    exit.addActionListener(this);

    c.add(back).setBounds(0, 0, 1800, 1000);
  }
예제 #8
0
  private void setComponents() {
    label1 = new JLabel("AWS");
    label1.setFont(new Font("Segoe UI Light", Font.PLAIN, 100));
    label1.setBounds(100, 300, 300, 90);
    label1.setForeground(Color.WHITE);
    add(label1);

    label2 = new JLabel("Advanced Wildlife Systems");
    label2.setFont(new Font("Segoe UI Light", Font.PLAIN, 20));
    label2.setBounds(75, 300, 300, 200);
    label2.setForeground(Color.WHITE);
    add(label2);

    label3 = new JLabel("AWS Internal Use Only");
    label3.setFont(new Font("Segoe UI Light", Font.PLAIN, 10));
    label3.setBounds(200, 320, 300, 200);
    label3.setForeground(Color.WHITE);
    add(label3);

    add = new Button(new ImageIcon("images/add.png"), new ImageIcon("images/addH.png"));
    add.setLocation(340, 270);
    add(add);

    find = new Button(new ImageIcon("images/find.png"), new ImageIcon("images/findH.png"));
    find.setLocation(519, 270);
    add(find);

    exit = new Button(new ImageIcon("images/exit.png"), new ImageIcon("images/exitH.png"));
    exit.setLocation(698, 270);
    add(exit);
  }
예제 #9
0
 protected void actionForeground() {
   Color color = JColorChooser.showDialog(this, "Foreground", panel.getForeground());
   if (color != null) {
     total.setForeground(color);
     time.setForeground(color);
   }
 }
예제 #10
0
  public void drawPoins() {
    int size;
    int dist = 20;
    JLabel welcome = new JLabel("Equipa 1 - " + Points.getRed() + " Pontos");
    welcome.setFont(new Font("Arial", Font.BOLD, 18));
    welcome.setForeground(Color.RED);
    size = 170;
    welcome.setBounds(((width - size) / 8) - dist, 100, size, 50);
    window.add(welcome);

    welcome = new JLabel("Equipa 2 - " + Points.getBlue() + " Pontos");
    welcome.setFont(new Font("Arial", Font.BOLD, 18));
    welcome.setForeground(Color.BLUE);
    welcome.setBounds((((width - size) * 7) / 8) + dist, 100, size, 50);
    window.add(welcome);

    welcome =
        new JLabel("Questao " + Questions7.pageid + " - " + Points.checkRed(Questions7.pageid));
    welcome.setFont(new Font("Arial", Font.BOLD, 15));
    welcome.setForeground(Color.RED);
    size = 170;
    welcome.setBounds(((width - size) / 8) - dist, 150, size, 50);
    window.add(welcome);

    welcome =
        new JLabel("Questao " + Questions7.pageid + " - " + Points.checkBlue(Questions7.pageid));
    welcome.setFont(new Font("Arial", Font.BOLD, 15));
    welcome.setForeground(Color.BLUE);
    welcome.setBounds((((width - size) * 7) / 8) + dist, 150, size, 50);
    window.add(welcome);
  }
예제 #11
0
 public void run() {
   if (logger.isDebugEnabled())
     logger.debug("Before doc={}", messagePanel.getTextPane().getStyledDocument());
   String text = messagePanel.getTextPane().getText();
   if (logger.isDebugEnabled())
     logger.debug("After1 doc={}", messagePanel.getTextPane().getStyledDocument());
   if (text != null) {
     Message message = new Message(text);
     messagePanel.setMessage(message);
     if (logger.isDebugEnabled())
       logger.debug("After2 doc={}", messagePanel.getTextPane().getStyledDocument());
     int len = text.length();
     if (len < 100) {
       charLabel.setForeground(Color.BLACK);
     } else if (len < 140) {
       charLabel.setForeground(Color.ORANGE);
     } else {
       charLabel.setForeground(Color.RED);
     }
     charLabel.setText("" + len);
     if (logger.isDebugEnabled())
       logger.debug("New message: {}\nElements: {}", message, message.getElements());
     int pos = messagePanel.getTextPane().getCaretPosition();
     Message.Element element = message.findElement(pos);
     if (logger.isDebugEnabled()) logger.debug("Element at caret: {}", element);
   }
   updating = false;
 }
  /** Constructor */
  public MapListCellRenderer() {
    JPanel pFirst = new JPanel();
    pFirst.setOpaque(false);
    pFirst.setLayout(new BorderLayout(5, 0));
    pFirst.add(mapNameLabel, BorderLayout.CENTER);
    pFirst.add(playerCountLabel, BorderLayout.EAST);
    pFirst.setAlignmentX(Component.LEFT_ALIGNMENT);
    rightPanelPart.add(pFirst);
    rightPanelPart.add(mapIdLabel);
    mapIdLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
    rightPanelPart.add(descriptionLabel);
    descriptionLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

    rightPanelPart.setOpaque(false);
    rightPanelPart.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    mapNameLabel.setFont(mapNameLabel.getFont().deriveFont(Font.BOLD));
    mapNameLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

    mapNameLabel.setForeground(FOREGROUND);
    mapIdLabel.setForeground(FOREGROUND);
    descriptionLabel.setForeground(FOREGROUND);
    playerCountLabel.setForeground(Color.BLUE);

    contentsPanel.setLayout(new BorderLayout());
    contentsPanel.add(rightPanelPart, BorderLayout.CENTER);
    contentsPanel.add(iconLabel, BorderLayout.WEST);
    contentsPanel.putClientProperty(ELFStyle.KEY, ELFStyle.PANEL_DRAW_BG_CUSTOM);

    iconLabel.setOpaque(false);
    iconLabel.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0));

    // Update UI
    SwingUtilities.updateComponentTreeUI(contentsPanel);
  }
예제 #13
0
  /** Create the panel. */
  public authorJPanel() {
    setBackground(Color.BLACK);
    setLayout(null);

    JLabel lblIot = new JLabel("IOT 13-1");
    lblIot.setHorizontalTextPosition(SwingConstants.CENTER);
    lblIot.setHorizontalAlignment(SwingConstants.CENTER);
    lblIot.setFont(new Font("SAO UI", Font.BOLD, 51));
    lblIot.setForeground(Color.WHITE);
    lblIot.setBounds(377, 61, 193, 102);
    add(lblIot);

    JLabel lblHanShukai = new JLabel(" Han Shukai");
    lblHanShukai.setIcon(new ImageIcon(authorJPanel.class.getResource("/image/skills_normal.png")));
    lblHanShukai.setForeground(Color.WHITE);
    lblHanShukai.setFont(new Font("SAO UI", Font.BOLD, 51));
    lblHanShukai.setBounds(345, 189, 250, 102);
    add(lblHanShukai);

    JLabel label = new JLabel("");
    label.setIcon(new ImageIcon(authorJPanel.class.getResource("/image/bniang.jpg")));
    label.setForeground(Color.WHITE);
    label.setFont(new Font("SAO UI", Font.BOLD, 51));
    label.setBounds(101, 104, 128, 266);
    add(label);

    //		JLabel lblGongchen = new JLabel(" GongChen");
    //		lblGongchen.setIcon(new
    // ImageIcon(authorJPanel.class.getResource("/image/skills_normal.png")));
    //		lblGongchen.setForeground(Color.WHITE);
    //		lblGongchen.setFont(new Font("SAO UI", Font.BOLD, 51));
    //		lblGongchen.setBounds(345, 300, 225, 102);
    //		add(lblGongchen);

  }
예제 #14
0
    public DisplayUserDirectory() {
      GridBagLayout gbl = new GridBagLayout();
      GridBagConstraints gbc = new GridBagConstraints();
      setLayout(gbl);

      gbc.anchor = GridBagConstraints.NORTHWEST;
      gbc.fill = GridBagConstraints.HORIZONTAL;

      hmlabel.setForeground(Color.black);
      add(hmlabel, gbc);
      add(Box.createHorizontalStrut(10), gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(hmdir, gbc);
      add(Box.createVerticalStrut(15), gbc);

      gbc.gridwidth = 1;
      vjlabel.setForeground(Color.black);
      add(vjlabel, gbc);
      add(Box.createHorizontalStrut(10), gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(vjdir, gbc);
      add(Box.createVerticalStrut(0), gbc);

      gbc.gridwidth = 1;
      vjlabel2.setForeground(Color.black);
      add(vjlabel2, gbc);
      setBorder(
          new CompoundBorder(
              // i18n
              // BorderFactory.createTitledBorder(" User_Directories "),
              BorderFactory.createTitledBorder(Util.getAdmLabel("_admin_User_Directories")),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
예제 #15
0
  void makeFrame() {
    JPanel p = new JPanel();
    p.setBackground(Color.blue);
    p.setLayout(new BorderLayout(0, 0));
    p.setBorder(new EmptyBorder(0, GAP, GAP, GAP));
    days.setFont(BIG);
    days.setForeground(COLOR);
    p.add(days, "North");
    left.setFont(NORM);
    left.setForeground(COLOR);
    p.add(left, "South");

    JFrame f = new JFrame("Sayaç"); // a window
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.setContentPane(p);
    setDate();
    f.pack(); // minimal size
    f.setVisible(true); // show

    f.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            stop();
          }
        });
  }
  private static void configControls(
      String optionName,
      int value,
      boolean highlight,
      JLabel sizeLabel,
      JTextField sizeField,
      JLabel unitsLabel,
      JLabel currentValueLabel) {
    sizeLabel.setText(optionName);

    String formatted =
        value == -1
            ? DiagnosticBundle.message("diagnostic.out.of.memory.currentValue.unknown")
            : String.valueOf(value);
    sizeField.setText(formatted);
    currentValueLabel.setText(
        DiagnosticBundle.message("diagnostic.out.of.memory.currentValue", formatted));

    if (highlight) {
      sizeLabel.setForeground(Color.RED);
      sizeField.setForeground(Color.RED);
      unitsLabel.setForeground(Color.RED);
      currentValueLabel.setForeground(Color.RED);
    }
  }
예제 #17
0
  /** Draws the communication lines. */
  private void drawCommunications() {
    Font fnt = new Font("Serif", Font.PLAIN, windowHeight / 60);
    Set<Coord> com;
    if (p0Coms) {
      com = board.getCommunications(0);

      for (Coord c : com)
        if (matrix[c.x][c.y] == null) {
          JLabel tmp = new JLabel("o", SwingConstants.CENTER);
          tmp.setFont(fnt);
          tmp.setForeground(COLOR_COM_PLAYER0);
          squares[c.x][c.y].add(tmp);
        }
    }
    if (p1Coms) {
      com = board.getCommunications(1);
      for (Coord c : com) {
        if (matrix[c.x][c.y] == null) {
          JLabel tmp = new JLabel("o", SwingConstants.CENTER);
          tmp.setFont(fnt);
          tmp.setForeground(COLOR_COM_PLAYER1);
          squares[c.x][c.y].add(tmp);
        }
      }
    }
  }
예제 #18
0
  /*
   * 初始化窗口变量
   */
  public void initframe() {
    flogin.setTitle("欢迎来到江西农业大学");
    userName = new JLabel("用户名:");
    userName.setForeground(Color.white);
    userName.setFont(new Font("宋体", Font.BOLD, 15));
    userPassword = new JLabel("密  码:");
    userPassword.setForeground(Color.white);
    userPassword.setFont(new Font("宋体", Font.BOLD, 15));
    passWd = new JPasswordField(12);
    user = new JTextField(12);
    signIn = new JButton("登录");
    signIn.setFont(new Font("宋体", Font.BOLD, 15));
    signIn.setBackground(new Color(10, 97, 190));

    signIn.setForeground(Color.white);
    reset = new JButton("重置");
    reset.setBackground(Color.blue);
    reset.setForeground(Color.white);
    reset.setFont(new Font("宋体", Font.BOLD, 15));
    reset.setBackground(new Color(10, 97, 190));
    checkno = new JLabel("验证码:");
    checkno.setForeground(Color.white);
    checkno.setFont(new Font("宋体", Font.BOLD, 15));
    checktflogin = new JTextField(12);
  }
예제 #19
0
  private JPanel getYearAndMonthPanal() {
    Calendar c = getDateCalendar();
    int currentYear = c.get(Calendar.YEAR);
    int currentMonth = c.get(Calendar.MONTH) + 1;
    int currentHour = c.get(Calendar.HOUR_OF_DAY);
    int currentMinute = c.get(Calendar.MINUTE);
    int currentSecond = c.get(Calendar.SECOND);

    JPanel result = new JPanel();
    result.setLayout(new FlowLayout());
    result.setBackground(controlLineColor);

    yearSpin = new JSpinner(new SpinnerNumberModel(currentYear, startYear, lastYear, 1));
    yearSpin.setPreferredSize(new Dimension(48, 20));
    yearSpin.setName("Year");
    yearSpin.setEditor(new JSpinner.NumberEditor(yearSpin, "####"));
    yearSpin.addChangeListener(this);
    result.add(yearSpin);
    JLabel yearLabel = new JLabel("年");
    yearLabel.setForeground(controlTextColor);
    result.add(yearLabel);

    monthSpin = new JSpinner(new SpinnerNumberModel(currentMonth, 1, 12, 1));
    monthSpin.setPreferredSize(new Dimension(35, 20));
    monthSpin.setName("Month");
    monthSpin.addChangeListener(this);
    result.add(monthSpin);
    JLabel monthLabel = new JLabel("月");
    monthLabel.setForeground(controlTextColor);
    result.add(monthLabel);

    hourSpin = new JSpinner(new SpinnerNumberModel(currentHour, 0, 23, 1));
    hourSpin.setPreferredSize(new Dimension(35, 20));
    hourSpin.setName("Hour");
    hourSpin.addChangeListener(this);
    result.add(hourSpin);
    JLabel hourLabel = new JLabel("时");
    hourLabel.setForeground(controlTextColor);
    result.add(hourLabel);

    minuteSpin = new JSpinner(new SpinnerNumberModel(currentMinute, 0, 59, 1));
    minuteSpin.setPreferredSize(new Dimension(35, 20));
    minuteSpin.setName("Minute");
    minuteSpin.addChangeListener(this);
    result.add(minuteSpin);
    JLabel minuteLabel = new JLabel("分");
    hourLabel.setForeground(controlTextColor);
    result.add(minuteLabel);

    secondSpin = new JSpinner(new SpinnerNumberModel(currentSecond, 0, 59, 1));
    secondSpin.setPreferredSize(new Dimension(35, 20));
    secondSpin.setName("Second");
    secondSpin.addChangeListener(this);
    result.add(secondSpin);
    JLabel secondLabel = new JLabel("秒");
    secondLabel.setForeground(controlTextColor);
    result.add(secondLabel);

    return result;
  }
예제 #20
0
  private void jButton1ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ActionPerformed

    OpenFastaFile f = new OpenFastaFile("", "");
    try { // f.showSaveDataDialog();
      FilePath = f.showOpenDataDialog();
    } catch (IOException ex) {
      //            Logger.getLogger(Browser.class.getName()).log(Level.SEVERE, null, ex);
    }

    if (FilePath.isEmpty()) {
      return;
    }
    Box vertical = Box.createVerticalBox();
    vertical.setSize(this.scrollPane1.getWidth(), this.scrollPane1.getHeight());
    siRNA s = new siRNA(new File(FilePath));

    siRnaInputArea.setText(s.getGene());

    if (s.isValid()) {
      List list = s.siRNA();
      t1.setText(list.get(0).toString());
      t2.setText(list.get(1).toString());
      s1.setForeground(Color.black);
      s2.setForeground(Color.black);
    }
  } // GEN-LAST:event_jButton1ActionPerformed
  public VistaCiudadesDisponibles(ModeloJuego modelo, Controlador control) {

    this.modelo = modelo;
    this.modelo.addObserver(this);
    this.ciudad1 = new JLabel("ciudad 1");
    this.ciudad2 = new JLabel("ciudad 2");
    this.ciudad3 = new JLabel("ciudad 3");
    this.ciudad4 = new JLabel("ciudad 4");
    Font fuente = new Font(Font.SANS_SERIF, Font.BOLD, 25);
    ciudad1.setFont(fuente);
    ciudad2.setFont(fuente);
    ciudad3.setFont(fuente);
    ciudad4.setFont(fuente);
    ciudad1.setForeground(Color.WHITE);
    ciudad2.setForeground(Color.WHITE);
    ciudad3.setForeground(Color.WHITE);
    ciudad4.setForeground(Color.WHITE);
    setLayout(new GridLayout(9, 1, 1, 1));

    add(ciudad1);
    add(ciudad2);
    add(ciudad3);
    add(ciudad4);

    setVisible(true);
  }
예제 #22
0
  public void initSiRNA() {

    siRNA s = new siRNA("p53.fasta");
    List list = s.siRNA();
    vertical.setBackground(new java.awt.Color(255, 215, 0));
    vertical.setSize(this.scrollPane1.getWidth(), this.scrollPane1.getHeight());

    s1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    s2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    //
    // Modify the text color
    s1.setForeground(Color.black);
    s2.setForeground(Color.black);
    s1.setFont(new java.awt.Font("Arial Black", 0, 18));
    s2.setFont(new java.awt.Font("Arial Black", 0, 18));
    // Modify the background color
    // s1.setBackground(new Color(255, 192, 16));
    // s2.setBackground(new Color(255, 192, 16));
    //

    t1 = new JTextArea();
    t2 = new JTextArea();
    //        t1.setLineWrap(true);
    //        t2.setLineWrap(true);
    t1.setText(list.get(0).toString());
    t2.setText(list.get(1).toString());

    vertical.add(s1);
    vertical.add(t1);
    vertical.add(s2);
    vertical.add(t2);

    scrollPane1.add(vertical);
  }
예제 #23
0
 /**
  * This method initializes this
  *
  * @return void
  */
 private void initialize() {
   GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
   gridBagConstraints2.gridx = 2;
   gridBagConstraints2.gridy = 0;
   duration = new JLabel();
   duration.setText("Duration");
   duration.setForeground(Color.WHITE);
   GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
   gridBagConstraints1.fill = GridBagConstraints.BOTH;
   gridBagConstraints1.gridy = 0;
   gridBagConstraints1.weightx = 1.0;
   gridBagConstraints1.gridx = 1;
   GridBagConstraints gridBagConstraints = new GridBagConstraints();
   gridBagConstraints.gridx = 0;
   gridBagConstraints.gridy = 0;
   timeLabel = new JLabel();
   timeLabel.setText("Time");
   timeLabel.setForeground(Color.WHITE);
   this.setSize(300, 200);
   this.setLayout(new GridBagLayout());
   this.setBackground(Color.BLACK);
   this.add(timeLabel, gridBagConstraints);
   this.add(getSlider(), gridBagConstraints1);
   this.add(duration, gridBagConstraints2);
 }
예제 #24
0
  public South(Draw d) {
    this.d = d;
    initTree(tree);
    setBackground(Color.black);
    send.addActionListener(this);
    step.addActionListener(this);

    node1.setForeground(Color.white);
    this.add(node1);
    attachment1.setColumns(4);
    this.add(attachment1);

    node2.setForeground(Color.white);
    this.add(node2);
    attachment2.setColumns(4);
    this.add(attachment2);

    cost.setForeground(Color.white);
    this.add(cost);
    valueOfArc.setColumns(4);
    this.add(valueOfArc);
    this.add(send);
    this.add(step);

    author.setFont(new Font("SimSun-ExtB", Font.ITALIC, 10));
    author.setForeground(Color.BLACK);

    this.add(author);
    lblCebotarencoDan.setFont(new Font("SimSun-ExtB", Font.ITALIC, 10));
    lblCebotarencoDan.setForeground(Color.WHITE);

    add(lblCebotarencoDan);
  }
예제 #25
0
  /**
   * Creates the <tt>Component</tt> hierarchy of the area of status-related information such as
   * <tt>CallPeer</tt> display name, call duration, security status.
   *
   * @return the root of the <tt>Component</tt> hierarchy of the area of status-related information
   *     such as <tt>CallPeer</tt> display name, call duration, security status
   */
  private Component createStatusBar() {
    // stateLabel
    callStatusLabel.setForeground(Color.WHITE);
    dtmfLabel.setForeground(Color.WHITE);
    callStatusLabel.setText(callPeer.getState().getLocalizedStateString());

    PeerStatusPanel statusPanel = new PeerStatusPanel(new GridBagLayout());

    GridBagConstraints constraints = new GridBagConstraints();

    constraints.gridx = 0;
    constraints.gridy = 0;
    statusPanel.add(securityStatusLabel, constraints);
    initSecurityStatusLabel();

    constraints.gridx++;
    statusPanel.add(holdStatusLabel, constraints);

    constraints.gridx++;
    statusPanel.add(muteStatusLabel, constraints);

    constraints.gridx++;
    callStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 3, 2, 12));
    statusPanel.add(callStatusLabel, constraints);

    constraints.gridx++;
    constraints.weightx = 1f;
    statusPanel.add(dtmfLabel, constraints);

    return statusPanel;
  }
    public MyJObject(int i) {
      CourseCheckBox = new JCheckBox(DataTransfer.Courses.elementAt(i));
      CourseCheckBox.setForeground(Color.WHITE);
      CourseCheckBox.setFont(new Font("SERRIF", Font.BOLD + Font.ITALIC, 13));
      CourseCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
      CourseCheckBox.setOpaque(false);
      CourseCheckBox.setSelected(true);

      TotalMarks =
          new JLabel(
              Float.toString(
                  Float.valueOf(
                      TwoDecimal.format(Float.parseFloat(DataTransfer.Total.elementAt(i))))),
              SwingConstants.CENTER);
      TotalMarks.setForeground(Color.WHITE);
      TotalMarks.setFont(new Font("SERRIF", Font.BOLD + Font.ITALIC, 13));

      GradePoint = new JLabel(DataTransfer.GradePoint.elementAt(i), SwingConstants.LEFT);
      GradePoint.setForeground(Color.WHITE);
      GradePoint.setFont(new Font("SERRIF", Font.ITALIC, 13));

      LetterGrade = new JLabel(DataTransfer.LetterGrade.elementAt(i), SwingConstants.LEFT);
      LetterGrade.setForeground(Color.WHITE);
      LetterGrade.setFont(new Font("SERRIF", Font.PLAIN, 13));

      CreditLabel = new JLabel(Credit.elementAt(i), SwingConstants.LEFT);
      CreditLabel.setForeground(Color.WHITE);
      CreditLabel.setFont(new Font("SERRIF", Font.PLAIN, 13));

      ExamTypeLabel = new JLabel(DataTransfer.ExamType.elementAt(i), SwingConstants.LEFT);
      ExamTypeLabel.setForeground(Color.WHITE);
      ExamTypeLabel.setFont(new Font("SERRIF", Font.PLAIN, 12));
    }
  private Component panelCentro() {
    JPanel panel = new JPanel(new GridLayout(2, 2, 20, 10));
    JLabel lValor;
    JLabel lValor1;

    JTextField text = new JTextField();
    JPasswordField pass = new JPasswordField();

    panel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(0, Color.RED, Color.red), "Identificacion"));

    lValor = new JLabel();
    lValor.setFont(new Font("Verdana", Font.CENTER_BASELINE, 12));
    lValor.setForeground(Color.black);
    lValor.setHorizontalAlignment(lValor.LEFT);

    lValor1 = new JLabel();
    lValor1.setFont(new Font("Verdana", Font.CENTER_BASELINE, 12));
    lValor1.setForeground(Color.black);
    lValor1.setHorizontalAlignment(lValor.LEFT);

    lValor.setText("Usuario:");
    panel.add(lValor);

    lValor.setText("Contraseña:");
    panel.add(lValor1);

    text = new JTextField();

    pass = new JPasswordField();

    return panel;
  }
예제 #28
0
  @Override
  public Component getTableCellRendererComponent(
      JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    textLabel.setFont(table.getFont());
    textLabel.setText(Objects.toString(value, ""));
    textLabel.setBorder(hasFocus ? focusCellHighlightBorder : noFocusBorder);

    FontMetrics fm = table.getFontMetrics(table.getFont());
    Insets i = textLabel.getInsets();
    int swidth =
        iconLabel.getPreferredSize().width + fm.stringWidth(textLabel.getText()) + i.left + i.right;
    int cwidth = table.getColumnModel().getColumn(column).getWidth();
    dim.width = swidth > cwidth ? cwidth : swidth;

    if (isSelected) {
      textLabel.setOpaque(true);
      textLabel.setForeground(table.getSelectionForeground());
      textLabel.setBackground(table.getSelectionBackground());
      iconLabel.setIcon(sicon);
    } else {
      textLabel.setOpaque(false);
      textLabel.setForeground(table.getForeground());
      textLabel.setBackground(table.getBackground());
      iconLabel.setIcon(nicon);
    }
    return panel;
  }
    private JComponent createLogo() {
      NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout());
      ApplicationInfoEx app = ApplicationInfoEx.getInstanceEx();
      JLabel logo = new JLabel(IconLoader.getIcon(app.getWelcomeScreenLogoUrl()));
      logo.setBorder(JBUI.Borders.empty(30, 0, 10, 0));
      logo.setHorizontalAlignment(SwingConstants.CENTER);
      panel.add(logo, BorderLayout.NORTH);
      JLabel appName = new JLabel(ApplicationNamesInfo.getInstance().getFullProductName());
      Font font = getProductFont();
      appName.setForeground(JBColor.foreground());
      appName.setFont(font.deriveFont(JBUI.scale(36f)).deriveFont(Font.PLAIN));
      appName.setHorizontalAlignment(SwingConstants.CENTER);
      String appVersion = "Version " + app.getFullVersion();

      if (app.isEAP() && app.getBuild().getBuildNumber() < Integer.MAX_VALUE) {
        appVersion += " (" + app.getBuild().asString() + ")";
      }

      JLabel version = new JLabel(appVersion);
      version.setFont(getProductFont().deriveFont(JBUI.scale(16f)));
      version.setHorizontalAlignment(SwingConstants.CENTER);
      version.setForeground(Gray._128);

      panel.add(appName);
      panel.add(version, BorderLayout.SOUTH);
      panel.setBorder(JBUI.Borders.emptyBottom(20));
      return panel;
    }
 /**
  * Renvoit le JPanel de gauche, avec le titre du champ. Utilisé dans le cas où il n'y a pas
  * d'enfants.
  */
 private JPanel getPanelGauche() {
   panelGauche = new JPanel(new FlowLayout(FlowLayout.LEFT));
   final JButton baide = new JButton(new ActionAide(refNoeud));
   baide.setFont(baide.getFont().deriveFont((float) 9));
   if (System.getProperty("os.name").startsWith("Mac OS")) {
     baide.setText("?");
     if ("10.5".compareTo(System.getProperty("os.version")) <= 0)
       baide.putClientProperty("JButton.buttonType", "help");
     else baide.putClientProperty("JButton.buttonType", "toolbar");
   } else {
     baide.setIcon(new ImageIcon(ImageKeeper.loadImage("images/aide.png")));
     baide.setMargin(new Insets(0, 0, 0, 0));
     baide.setBorderPainted(false);
     baide.setContentAreaFilled(false);
   }
   String documentation = getDocumentation();
   if (documentation != null) baide.setToolTipText(documentation);
   if (documentation == null && attribut) baide.setEnabled(false);
   panelGauche.add(baide);
   labelTitre = new JLabel(getTitre());
   if (affParent != null) {
     if (obligatoire()) labelTitre.setForeground(couleurObligatoire);
     else labelTitre.setForeground(couleurFacultatif);
   }
   panelGauche.add(labelTitre);
   return (panelGauche);
 }