Exemple #1
0
 /**
  * A change in the text fields.
  *
  * @param e the document event.
  */
 private void documentChanged(DocumentEvent e) {
   if (e.getDocument().equals(fileCountField.getDocument())) {
     // set file count only if its un integer
     try {
       int newFileCount = Integer.valueOf(fileCountField.getText());
       fileCountField.setForeground(Color.black);
       LoggingUtilsActivator.getPacketLoggingService()
           .getConfiguration()
           .setLogfileCount(newFileCount);
     } catch (Throwable t) {
       fileCountField.setForeground(Color.red);
     }
   } else if (e.getDocument().equals(fileSizeField.getDocument())) {
     // set file size only if its un integer
     try {
       int newFileSize = Integer.valueOf(fileSizeField.getText());
       fileSizeField.setForeground(Color.black);
       LoggingUtilsActivator.getPacketLoggingService()
           .getConfiguration()
           .setLimit(newFileSize * 1000);
     } catch (Throwable t) {
       fileSizeField.setForeground(Color.red);
     }
   }
 }
Exemple #2
0
  public RFIDGUI() {

    setLayout(new FlowLayout());
    // label = new JTextField(ThreadTwoTestTwo.randomQuestionStatement);
    Question.setFont(new Font("Serif", Font.BOLD, 18));
    // Points.setFont(new Font("Serif", Font.BOLD, 50));
    // Question.setBounds(300, 250, 900, 300);
    // Points.setBounds(1200, 600, 300, 200);

    // Points.setHorizontalAlignment(JTextField.RIGHT);
    // Points.set
    Question.setForeground(Color.blue);
    // Points.setForeground(Color.red);
    add(Question);
    // Question.validate();
    // add(Points, BorderLayout.SOUTH);
    // Points.validate();
    // Question.setLocation(0, 0);
    // Points.setLocation(1600,900);

    /*while(count<70){
    //secondDoneYet = false;
    while (!secondDoneYet) {
    	//label = new JTextField(ThreadTwoTestTwo.randomQuestionStatement);
    	label.repaint();
    	secondDoneYet = true;
    	count++;

    	/*
    	 * while(ThreadTwoTestTwo.amountOfQuestions <=60){
    	 * label.repaint(); }
    	 */
  }