/**
   * Makes the control panel to show while in batch mode.
   *
   * @return Panel with batch controls.
   */
  public static JPanel makeBatchControlsPanel() {

    JPanel jLine1Controls = new JPanel(new FlowLayout(FlowLayout.LEFT));

    // Bins boxes
    JLabel jTemp = new JLabel("Number of bins:");
    jTemp.setFont(new sortie.gui.components.SortieFont());
    jLine1Controls.add(jTemp);

    JTextField jNumBins = new JTextField(String.valueOf(NUMBER_BINS_DEFAULT));
    jNumBins.setFont(new SortieFont());
    jNumBins.setPreferredSize(
        new java.awt.Dimension(50, (int) jNumBins.getPreferredSize().getHeight()));
    jNumBins.setName(NUMBER_BINS_NAME);
    jLine1Controls.add(jNumBins);

    jTemp = new JLabel("Bin size:");
    jTemp.setFont(new sortie.gui.components.SortieFont());
    jLine1Controls.add(jTemp);
    JTextField jBinSize = new JTextField(String.valueOf(BIN_SIZE_DEFAULT));
    jBinSize.setFont(new SortieFont());
    jBinSize.setPreferredSize(
        new java.awt.Dimension(50, (int) jBinSize.getPreferredSize().getHeight()));
    jBinSize.setName(BIN_SIZE_NAME);
    jLine1Controls.add(jBinSize);

    return jLine1Controls;
  }
  @Override
  public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    Object source = e.getSource();

    if (source == ok) {
      userResponse = APPLY_OPTION;
      this.setVisible(false);
    } else if (source == cancel) {
      userResponse = CANCEL_OPTION;
      this.setVisible(false);
    } else if (source == fontCombo) {
      @SuppressWarnings("unchecked")
      JComboBox<String> cb = (JComboBox<String>) source;
      String s = (String) cb.getSelectedItem();
      Font tmp = example.getFont();
      example.setFont(new Font(s, tmp.getStyle(), tmp.getSize()));
    } else if (source == sizeCombo) {
      @SuppressWarnings("unchecked")
      JComboBox<String> cb = (JComboBox<String>) source;
      String s = (String) cb.getSelectedItem();
      int newSize = Integer.parseInt(s);
      Font tmp = example.getFont();
      example.setFont(new Font(tmp.getFamily(), tmp.getStyle(), newSize));
    } else if (source == foreground) {
      Color tmp = JColorChooser.showDialog(this, "Choose text color", example.getForeground());
      if (tmp != null) example.setForeground(tmp);
    }
  }
Пример #3
0
    @Override
    public void actionPerformed(ActionEvent e) {
      // TODO Auto-generated method stub

      Object source = e.getSource();
      if (source == ok) {
        response = APPLY_OPTION;
        this.setVisible(false);
      } else if (source == cancel) {
        response = CANCEL_OPTION;
        this.setVisible(false);
      } else if (source == sizeCombo) {
        // get the number from the source
        JComboBox number = (JComboBox) source;
        String numberItem = (String) number.getSelectedItem();
        Font temp = example.getFont();
        // then set the font
        int newSize = Integer.parseInt(numberItem);
        example.setFont(new Font(temp.getFamily(), temp.getStyle(), newSize));
      } else if (source == fontCombo) {
        JComboBox font = (JComboBox) source;
        String s = (String) font.getSelectedItem();
        Font tmp = example.getFont();
        example.setFont(new Font(s, tmp.getStyle(), tmp.getSize()));
      } else if (source == foreground) {
        Color tmp = JColorChooser.showDialog(this, "Choose text color", example.getForeground());
        MenuBar.shapeLBG.setBackground(tmp);
        if (tmp != null) example.setForeground(tmp);
      }
    }
Пример #4
0
  /** Create the frame. */
  public ImageSaveFrame() {
    setTitle("\u8BFB\u53D6\u6587\u4EF6\u8DEF\u5F84\u5230\u6570\u636E\u5E93");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 400, 180);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(new GridLayout(3, 1, 5, 5));

    JPanel pathPanel = new JPanel();
    contentPane.add(pathPanel);

    JLabel pathLabel = new JLabel("\u8DEF\u5F84\u540D\uFF1A");
    pathLabel.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
    pathPanel.add(pathLabel);

    pathTextField = new JTextField();
    pathTextField.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
    pathPanel.add(pathTextField);
    pathTextField.setColumns(15);

    JPanel namePanel = new JPanel();
    contentPane.add(namePanel);

    JLabel nameLabel = new JLabel("\u6587\u4EF6\u540D\uFF1A");
    nameLabel.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
    namePanel.add(nameLabel);

    nameTextField = new JTextField();
    nameTextField.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
    namePanel.add(nameTextField);
    nameTextField.setColumns(15);

    JPanel buttonPanel = new JPanel();
    contentPane.add(buttonPanel);

    JButton chooseButton = new JButton("\u9009\u62E9\u56FE\u7247");
    chooseButton.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
    chooseButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            do_chooseButton_actionPerformed(arg0);
          }
        });
    buttonPanel.add(chooseButton);

    JButton saveButton = new JButton("\u4FDD\u5B58\u56FE\u7247");
    saveButton.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
    saveButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            do_saveButton_actionPerformed(arg0);
          }
        });
    buttonPanel.add(saveButton);
  }
  /**
   * Create the pixel location panel
   *
   * @param labelFont the font for the labels
   * @return the location panel
   */
  public JPanel createLocationPanel(Font labelFont) {

    // create a location panel
    JPanel locationPanel = new JPanel();
    locationPanel.setLayout(new FlowLayout());
    Box hBox = Box.createHorizontalBox();

    // create the labels
    rowLabel = new JLabel("Row:");
    colLabel = new JLabel("Column:");

    // create the text fields
    colValue = new JTextField(Integer.toString(colIndex + numberBase), 6);
    colValue.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            displayPixelInformation(colValue.getText(), rowValue.getText());
          }
        });
    rowValue = new JTextField(Integer.toString(rowIndex + numberBase), 6);
    rowValue.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            displayPixelInformation(colValue.getText(), rowValue.getText());
          }
        });

    // set up the next and previous buttons
    setUpNextAndPreviousButtons();

    // set up the font for the labels
    colLabel.setFont(labelFont);
    rowLabel.setFont(labelFont);
    colValue.setFont(labelFont);
    rowValue.setFont(labelFont);

    // add the items to the vertical box and the box to the panel
    hBox.add(Box.createHorizontalGlue());
    hBox.add(rowLabel);
    hBox.add(rowPrevButton);
    hBox.add(rowValue);
    hBox.add(rowNextButton);
    hBox.add(Box.createHorizontalStrut(10));
    hBox.add(colLabel);
    hBox.add(colPrevButton);
    hBox.add(colValue);
    hBox.add(colNextButton);
    locationPanel.add(hBox);
    hBox.add(Box.createHorizontalGlue());

    return locationPanel;
  }
  private void textFieldFactory() {
    nameTextField = new JTextField();
    nameTextField.setFont(Constants.defaultFont);

    associationFilePathTextField = new JTextField();
    associationFilePathTextField.setEditable(false);
    associationFilePathTextField.setFont(Constants.defaultFont);
    associationFilePathTextField.addMouseListener(
        new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            associationFilePathTextFieldMouseClicked(e);
          }
        });
  }
Пример #7
0
  public UpdaterSelectWizardPanel(UpdaterData data) {
    super();

    data_ = data;

    setPreferredSize(new Dimension(500, 400));

    addButtons(NEXT_BACK_CANCEL);
    setEnableButton(BUTTON_BACK, false);
    useHeaderPanel(HEADER, SUBHEADER, "/imc/lecturnity/converter/images/lecturnity_logo.gif");

    getContentPanel().setLayout(null);

    JLabel desc = new JLabel(SELECT);
    desc.setFont(NORMAL_FONT);
    desc.setLocation(30, 100);
    desc.setSize(460, 15);
    getContentPanel().add(desc);

    presentationFileField_ = new JTextField("");
    presentationFileField_.setFont(NORMAL_FONT);
    presentationFileField_.setLocation(30, 120);
    presentationFileField_.setSize(440, 22);
    getContentPanel().add(presentationFileField_);

    JButton findButton = new JButton(FIND);
    // if (imc.lecturnity.converter.ConverterWizard.USE_CUSTOM_COLORS)
    if (USE_CUSTOM_COLORS) findButton.setBackground(Wizard.BG_COLOR);
    findButton.setSize(120, 30);
    findButton.setLocation(30, 148);
    findButton.setMnemonic(MNEM_FIND);
    findButton.addActionListener(new FindButtonListener());
    getContentPanel().add(findButton);
  }
  public SurrenderUI() {
    setType(Type.UTILITY);

    ExitB = new JButton("Exit");
    ExitB.setFont(new Font("Tahoma", Font.BOLD, 12));
    ExitB.setBackground(new Color(255, 215, 0));
    ExitB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            dispose();
            new HSmain();
          }
        });
    ExitB.setBounds(461, 427, 296, 60);

    setTitle("Surrendering a Pet");
    Container pane = getContentPane();
    getContentPane().setLayout(null);
    pane.add(ExitB);

    txtSurrender = new JTextField();
    txtSurrender.setEditable(false);
    txtSurrender.setForeground(new Color(0, 0, 0));
    txtSurrender.setBackground(new Color(255, 215, 0));
    txtSurrender.setBounds(10, 11, 764, 50);
    txtSurrender.setHorizontalAlignment(SwingConstants.CENTER);
    txtSurrender.setFont(new Font("Lucida Handwriting", Font.BOLD, 18));
    txtSurrender.setText("Surrendering a Pet");
    getContentPane().add(txtSurrender);
    txtSurrender.setColumns(10);

    BackB = new JButton("Back");
    BackB.setFont(new Font("Tahoma", Font.BOLD, 12));
    BackB.setBackground(new Color(255, 215, 0));
    BackB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            new AnimalServiceUI();
            dispose();
          }
        });
    BackB.setBounds(26, 427, 320, 60);
    getContentPane().add(BackB);

    scrollPane = new JScrollPane();
    scrollPane.setBounds(0, 72, 764, 329);
    getContentPane().add(scrollPane);

    JTextPane txtSurrenderInfo = new JTextPane();
    scrollPane.setViewportView(txtSurrenderInfo);
    txtSurrenderInfo.setForeground(new Color(0, 0, 0));
    txtSurrenderInfo.setEditable(false);
    txtSurrenderInfo.setFont(new Font("Times New Roman", Font.BOLD, 15));
    txtSurrenderInfo.setText(
        "\tThe Humane Society of Lamar cannot accept every animal brought to our shelter immediately. \r\nWe respect the difficult decision of owners to relinquish their pets, and the hard choices of those \r\ngood citizens who are trying to help a stray. We accept the surrender of pets as space allows. \r\nWe maintain a waiting list for all animals needing to be admitted to the shelter.\r\nAnimals are surrendered to our facility by appointment.\r\nWe admit at least 12 animals per week. We accept more animals as adoptions and space allow.\r\nNote that we cannot accept aggressive, sick or pregnant animals.\r\nPlease call 409-225-7981, and one of our adoption specialists will speak to you.\r\nAt times our waiting list will have up to 100 animals waiting for admission and it can take several weeks \r\nbefore we can admit your pet.\r\nPlease understand that our primary goal is to place as many animals in forever homes as possible, \r\ntherefore we must give every pet admitted to the shelter enough time to find a loving home. \r\nWe cannot guarantee placement of every animal admitted to the shelter.\r\n\t\r\n\tAdmission of any animal into the Humane Society of Lamar  is based on the animal\u2019s health, \r\nbehavior, and adoptability. When you bring your pets, please have:\r\n\r\n    *Any veterinary records\r\n    *Your pet\u2019s medications\r\n    *Special food or treats that your pet needs\r\n    *Your pet\u2019s bed, toys, leash and other belongings from home\r\n\r\nA staff member will evaluate the temperament of your pet. Once your pet has been screened, \r\nand the Humane Society of Lamar decides to accept your pet, we ask a donation to our shelter to be made. \r\nThis is not required, but will greatly help us care for your pet.");

    setSize(800, 553);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  }
Пример #9
0
  @Override
  public JFrame createWindow(JGamePanel gamePanel) {
    // Initialize layout components
    JPanel mainPanel = new JPanel();
    SpringLayout layout = new SpringLayout();
    mainPanel.setLayout(layout);

    // Initialize each component
    JFrame window = new JFrame();
    mainPanel.add(gamePanel);
    JTextArea logArea = new JTextArea();
    JScrollPane logScrollPane = new JScrollPane(logArea);
    logScrollPane.setPreferredSize(new Dimension(0, 0));
    mainPanel.add(logScrollPane);
    logArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    logArea.setEditable(false);
    JTextField commandField = new JTextField();
    commandField.setPreferredSize(new Dimension(0, 20));
    commandField.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    mainPanel.add(commandField);

    // Layout compo6nents
    layout.putConstraint(SpringLayout.NORTH, gamePanel, 0, SpringLayout.NORTH, mainPanel);
    layout.putConstraint(SpringLayout.NORTH, logScrollPane, 0, SpringLayout.SOUTH, gamePanel);
    layout.putConstraint(SpringLayout.SOUTH, logScrollPane, 0, SpringLayout.NORTH, commandField);
    layout.putConstraint(SpringLayout.SOUTH, commandField, 0, SpringLayout.SOUTH, mainPanel);
    layout.putConstraint(SpringLayout.WEST, logScrollPane, 0, SpringLayout.WEST, mainPanel);
    layout.putConstraint(SpringLayout.WEST, commandField, 0, SpringLayout.WEST, mainPanel);
    layout.putConstraint(SpringLayout.EAST, logScrollPane, 0, SpringLayout.EAST, mainPanel);
    layout.putConstraint(SpringLayout.EAST, commandField, 0, SpringLayout.EAST, mainPanel);

    window.getContentPane().add(mainPanel);
    return window;
  }
Пример #10
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(); }
    	 */
  }
Пример #11
0
 /**
  * JBuilder自动生成的初始化界面方法
  *
  * @throws Exception
  */
 private void jbInit() throws Exception {
   jPanel1.setLayout(borderLayout1);
   jPanel3.setPreferredSize(new Dimension(10, 30));
   jPanel4.setPreferredSize(new Dimension(30, 10));
   jPanel5.setPreferredSize(new Dimension(30, 10));
   jPanel6.setPreferredSize(new Dimension(10, 30));
   jPanel2.setLayout(verticalFlowLayout1);
   MoneyDuom.setBackground(Color.white);
   MoneyDuom.setFont(new java.awt.Font("Dialog", 0, 16));
   MoneyDuom.setPreferredSize(new Dimension(100, 30));
   MoneyDuom.setEditable(true);
   MoneyDuom.setText("");
   jLabel1.setFont(new java.awt.Font("Dialog", 1, 16));
   jLabel1.setPreferredSize(new Dimension(70, 23));
   jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
   jLabel1.setText("金  额:");
   this.getContentPane().add(jPanel1, BorderLayout.CENTER);
   jPanel1.add(jPanel2, BorderLayout.CENTER);
   jPanel2.add(jPanel8, null);
   jPanel8.add(jLabel1, null);
   jPanel8.add(MoneyDuom, null);
   jPanel2.add(jPanel7, null);
   jPanel1.add(jPanel3, BorderLayout.SOUTH);
   jPanel1.add(jPanel4, BorderLayout.WEST);
   jPanel1.add(jPanel5, BorderLayout.EAST);
   jPanel1.add(jPanel6, BorderLayout.NORTH);
 }
Пример #12
0
  public static void main(String[] args) {
    JFrame frame = new JFrame("Program Okienkowy - Testowy"); // utworzenie ramki z tytulem
    frame.setSize(550, 350); // rozmiar dlugoscXwysokosc
    frame.setLocation(300, 300); // polozenie od lewego gornego rogu
    frame.setResizable(false); // false - nie mozna zmieniac rozmiaru okna( strzalkami )
    frame.setLayout(null); // widoczne pola na tle

    JTextField tekstField = new JTextField(); // pole tekstowe
    tekstField.setBounds(10, 10, 230, 50); // lokalizacja pola tekstowego i rozmiar
    Font font = new Font("Times New Roman", Font.BOLD, 14); // utworzenie czcionki w polu tekstowym
    tekstField.setFont(font); // ustawienie czcionki w polu tekstowym
    tekstField.setText(
        "Pole tekstowe - testowe"); // ustawienie poczatkowego tekstu w polu tekstowym
    frame.add(tekstField); // dodanie pola tekstowego do ramki

    JButton button = new JButton("Testowy Przycisk"); // tworzenie przycisku o tytule
    button.setBounds(300, 10, 230, 50); // lokalziacja i rozmiar buttonu
    button.setBorder(null); // null - wtopiony w tlo
    button.addActionListener(
        new ActionListener() { // funkcja dodaje AKCJE do przycisku
          public void actionPerformed(ActionEvent arg0) { // implementowana metoda
            int standardValue = 976;
            tekstField.setText("Tekst po nacisnieciu przycisku: " + standardValue); // zwykly test
          }
        });
    frame.add(button); // dodanie buttony do ramki

    frame.setVisible(true); // widocznosc
  }
  /*
   * The following method creates the textfield to change the text
   *     and the button to update the label.
   * postcondition: returns the panel containing the textfield and button.
   */
  public JPanel createUpdateButton() {
    JLabel textLabel = new JLabel(new String("Change text to: "));

    textField = new JTextField(new String("Big Java"), 20);
    textField.setFont(new Font(("Times"), Font.PLAIN, 12));

    update = new JButton(new String("Update"));
    update.setDefaultCapable(true);

    // This class is used to create a special ActionListener for this menu item
    class ButtonListener implements ActionListener {
      /*
       * This method is called when the update button is clicked
       */
      public void actionPerformed(ActionEvent event) {
        // Call the method to change the text on the screen.
        setSampleFont();
      } // end actionPerformed method
    }
    ActionListener listener = new ButtonListener();
    update.addActionListener(listener);

    JPanel panel = new JPanel();

    panel.add(textLabel);
    panel.add(textField);
    panel.add(update);

    return panel;
  } // end createUpdateButton method
  /**
   * @param doc
   * @return
   */
  private JPanel createForwardBackPanel(Document doc) {
    JPanel panel = new JPanel();
    JButton prev = new JButton("Prev");
    prev.setFont(font);
    prev.addActionListener(
        new ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent e) {
            previousFile();
          };
        });
    JButton next = new JButton("Next");
    next.setFont(font);
    next.addActionListener(
        new ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent e) {
            nextFile();
          };
        });
    fileNameField = new JTextField(doc.getDocumentId());
    fileNameField.setEditable(false);
    fileNameField.setFont(font);

    panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
    panel.add(prev);
    panel.add(Box.createHorizontalGlue());
    panel.add(fileNameField);
    panel.add(Box.createHorizontalGlue());
    panel.add(next);
    return panel;
  }
Пример #15
0
  public RoxSplash(Frame f, String initString) {
    super(f);

    jt.setFont(new Font("Verdana", Font.PLAIN, 9));
    jt.setText(initString);

    getContentPane().add(painel, BorderLayout.CENTER);
    getContentPane().add(jt, BorderLayout.SOUTH);

    pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    this.setSize(500, 310);

    setLocation(screenSize.width / 2 - 250, screenSize.height / 2 - 150);

    Runnable waitRunner =
        new Runnable() {
          public void run() {
            try {
              Thread.sleep(10);
            } catch (Exception e) {
            }
          }
        };
    setVisible(true);
    Thread splashThread = new Thread(waitRunner, "RoxSplash");
    splashThread.start();
  }
Пример #16
0
  @Override
  protected void prepareComponent(
      JPanel component,
      HierarchicalTable<Property> table,
      Property property,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column,
      boolean forEditor) {
    super.prepareComponent(
        component, table, property, value, isSelected, hasFocus, row, column, forEditor);

    if (property.getButtonText() == null) {
      button.setVisible(false);
    } else {
      button.setVisible(true);
      button.setText(property.getButtonText());
      button.setToolTipText(property.getButtonTooltip());
    }

    if (isSelected && !forEditor) {
      textfield.setBackground(table.getSelectionBackground());
      textfield.setForeground(table.getSelectionForeground());
    } else {
      textfield.setBackground(table.getBackground());
      textfield.setForeground(table.getStyle().getValueCellFontColor());
    }
    panel.setBackground(textfield.getBackground());
    textfield.setFont(table.getStyle().getValueCellFont());
    textfield.setBorder(null);

    textfield.setText(FORMAT.format(value));
  }
Пример #17
0
 private JTextField initializeGoToTextField() {
   JTextField textField = new JTextField();
   textField.setFont(new Font("Arial", Font.ITALIC, 10));
   textField.setEnabled(false);
   textField.addActionListener(this);
   textField.addFocusListener(this);
   return textField;
 }
Пример #18
0
 /**
  * This method initializes EmplacementjTextField
  *
  * @return javax.swing.JTextField
  */
 private JTextField getEmplacementjTextField() {
   if (EmplacementjTextField == null) {
     EmplacementjTextField = new JTextField();
     EmplacementjTextField.setBounds(new Rectangle(19, 23, 450, 27));
     EmplacementjTextField.setFont(new Font("Candara", Font.PLAIN, 12));
   }
   return EmplacementjTextField;
 }
Пример #19
0
  // methods
  public void updateMessage() {
    messageField.setText(message);
    messageField.setFont(messageFont);
    messageField.setForeground(foreground);
    messageField.setBackground(background);
    // tt = messageField.getText();

  }
  private BindCardWithSidWindow() {

    int width = 230;
    int height = 190;

    setLayout(null);
    setBounds(
        (Utilities.getScreenWidth() - width) / 2,
        (Utilities.getScreenHeight() - height) / 2,
        width,
        height);
    setAlwaysOnTop(true);
    setResizable(false);

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    JLabel cardPromptLbl = new JLabel("卡号:");
    cardPromptLbl.setFont(new Font("Courier New", 0, 15));
    cardPromptLbl.setBounds(30, 20, 50, 30);
    add(cardPromptLbl);

    JLabel sidPromptLbl = new JLabel("学号:");
    sidPromptLbl.setFont(new Font("Courier New", 0, 15));
    sidPromptLbl.setBounds(30, 50, 50, 30);
    add(sidPromptLbl);

    cardLbl = new JLabel("");
    cardLbl.setBackground(Color.blue);
    cardLbl.setFont(new Font("黑体", 0, 15));
    cardLbl.setHorizontalAlignment(JLabel.CENTER);
    cardLbl.setBounds(80, 20, 120, 30);
    add(cardLbl);

    sidField = new JTextField("");
    sidField.setHorizontalAlignment(JTextField.CENTER);
    sidField.setFont(new Font("黑体", 0, 15));
    sidField.setBounds(80, 50, 120, 30);
    add(sidField);

    confirmBtn = new JButton("确定");
    confirmBtn.setBounds(75, 100, 80, 40);
    confirmBtn.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {

            String text = sidField.getText();

            setVisible(false);

            if (text.length() != 0) {

              CardDatabase.bindCardWithStudent(cardLbl.getText(), text);
            }
          }
        });
    add(confirmBtn);
  }
Пример #21
0
  /** Create the panel for Welcome. */
  public Welcome() {
    setBackground(Color.YELLOW);
    setSize(648, 445);
    setLayout(null);

    // Creating labels, buttons, textFields and adding attributes

    JLabel snakeIcon = new JLabel("");
    snakeIcon.setBounds(400, 142, 242, 261);
    Image img1 = new ImageIcon(this.getClass().getResource("/img/snake-icon.png")).getImage();
    snakeIcon.setIcon(new ImageIcon(img1));
    add(snakeIcon);

    lblWelcome = new JLabel("Welcome to Snake-Emulator");
    lblWelcome.setFont(new Font("Lucida Grande", Font.BOLD | Font.ITALIC, 35));
    lblWelcome.setBounds(68, 70, 522, 44);
    add(lblWelcome);

    lblUsername = new JLabel("Username:"******"Lucida Grande", Font.PLAIN, 18));
    lblUsername.setBounds(126, 163, 98, 24);
    add(lblUsername);

    lblPassword = new JLabel("Password:"******"Lucida Grande", Font.PLAIN, 18));
    lblPassword.setBounds(126, 210, 98, 24);
    add(lblPassword);

    textFieldUsername = new JTextField();
    textFieldUsername.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
    textFieldUsername.setBounds(226, 161, 174, 28);
    add(textFieldUsername);
    textFieldUsername.setColumns(10);

    passwordField = new JPasswordField();
    passwordField.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
    passwordField.setBounds(226, 208, 174, 28);
    add(passwordField);

    btnLogin = new JButton("Login");
    btnLogin.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
    btnLogin.setBounds(255, 248, 138, 36);
    add(btnLogin);

    lblDontHaveA = new JLabel("Don't have a user?");
    lblDontHaveA.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
    lblDontHaveA.setBounds(78, 332, 164, 36);
    add(lblDontHaveA);

    btnSignUp = new JButton("Sign Up Here!");
    btnSignUp.setFont(new Font("Lucida Grande", Font.PLAIN, 18));
    btnSignUp.setBounds(243, 332, 164, 36);
    add(btnSignUp);

    lblYouHaveEntered = new JLabel("");
    lblYouHaveEntered.setFont(new Font("Lucida Grande", Font.PLAIN, 15));
    add(lblYouHaveEntered);
  }
Пример #22
0
  public EnterValue() {

    super("Enter Data");

    JLabel title = new JLabel("Entrada");
    title.setFont(mainFont);
    JLabel numeroConta = new JLabel("Nº Conta:");
    numeroConta.setFont(mainFont);
    JLabel valorRS = new JLabel("R$:");
    valorRS.setFont(mainFont);

    Container c = getContentPane();
    c.setLayout(new BorderLayout());
    JPanel p = new JPanel();
    p.setLayout(null);

    conta = new JTextField();
    conta.setFont(mainFont);
    valor = new JTextField();
    valor.setFont(mainFont);

    done = new JButton("Done");
    done.setFont(mainFont);
    done.setBounds(180, 132, 200, 25);

    /* IN ORDER */
    title.setBounds(240, 10, 200, 30);
    numeroConta.setBounds(40, 57, 100, 30);
    conta.setBounds(180, 60, 200, 25);
    valorRS.setBounds(70, 97, 80, 30);
    valor.setBounds(180, 100, 200, 25);

    p.add(title);
    p.add(numeroConta);
    p.add(conta);
    p.add(valorRS);
    p.add(valor);
    p.add(done);
    c.add(BorderLayout.CENTER, p);

    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setSize(500, 200);
    setVisible(true);
    setResizable(false);
  }
Пример #23
0
  private void setAllFonts() {

    Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 12);
    Font fontBold = new Font(Font.SANS_SERIF, Font.BOLD, 12);
    Font fontSmallItalic = new Font(Font.SANS_SERIF, Font.ITALIC, 10);

    lb_smtp.setFont(fontBold);
    tf_smtp.setFont(font);
    lb_smtpUser.setFont(fontBold);
    tf_smtpUser.setFont(font);
    lb_smtpPW.setFont(fontBold);
    pf_smtpPW.setFont(font);
    lb_from.setFont(fontBold);
    tf_from.setFont(font);
    lb_to.setFont(fontBold);
    tf_to.setFont(font);
    lb_cc.setFont(fontBold);
    tf_cc.setFont(font);
    lb_bcc.setFont(fontBold);
    tf_bcc.setFont(font);
    lb_subject.setFont(fontBold);
    tf_subject.setFont(font);
    ta_text.setFont(font);
    cb_attachXml.setFont(fontBold);
    cb_attachGif.setFont(fontBold);
    cb_attachPdf.setFont(fontBold);
    lnk_smtpInfo.setFont(fontSmallItalic);
    cb_smtp_auth.setFont(fontSmallItalic);
    cb_pwSave.setFont(fontSmallItalic);
  }
Пример #24
0
 private void addWelcomeMessage(String welcomeMsg) {
   JTextField welcomeMessage = new JTextField(welcomeMsg);
   welcomeMessage.setBounds(BOUNDS_WELCOME_MESSAGE);
   welcomeMessage.setHorizontalAlignment(JTextField.CENTER);
   welcomeMessage.setBorder(BorderFactory.createEmptyBorder());
   welcomeMessage.setFont(ClientUI.FONT_BOLD);
   welcomeMessage.setEditable(false);
   contentPanel.add(welcomeMessage);
 }
Пример #25
0
 private JTextField getAccionTextField() {
   if (accionTextField == null) {
     accionTextField = new JTextField();
     accionTextField.setLocation(new Point(139, 60));
     accionTextField.setFont(new Font("Dialog", Font.BOLD, 12));
     accionTextField.setSize(new Dimension(273, 18));
   }
   return accionTextField;
 }
Пример #26
0
  public static JTextField getTextField(int size) {
    JTextField component = new JTextField(size);
    component.setBackground(BACKGROUND_COLOR_TXTA);
    component.setForeground(TEXT_COLOR_TXTA);

    component.setFont(FONT_TYPE_TXTA);

    return component;
  }
Пример #27
0
  public void init() {
    this.setPreferredSize(new Dimension(500, 500));
    this.setMinimumSize(new Dimension(500, 500));

    this.setLocationRelativeTo(null);
    this.setUndecorated(true);

    this.pack();
    this.toFront();
    this.setLayout(new GridLayout(2, 1, 0, 0));

    panelSuperior = new JPanel(new GridLayout(4, 1, 0, 0));

    usuario = new JLabel(accion);
    usuario.setHorizontalAlignment(JLabel.CENTER);
    usuario.setFont(new Font("Arial", 0, 20));
    usuario.setOpaque(true);
    usuario.setBackground(Color.BLACK);
    usuario.setForeground(Color.white);

    this.cargo = new JLabel("SESION " + puesto);
    cargo.setHorizontalAlignment(JLabel.CENTER);
    cargo.setFont(new Font("Arial", 0, 36));
    cargo.setOpaque(true);
    cargo.setBackground(Color.BLACK);
    cargo.setForeground(Color.white);

    this.cargo = new JLabel("CARGO");
    cargo.setHorizontalAlignment(JLabel.CENTER);
    cargo.setFont(new Font("Arial", 0, 36));
    cargo.setOpaque(true);
    cargo.setBackground(Color.BLACK);
    cargo.setForeground(Color.white);

    this.usuarioIn = new JTextField();
    usuarioIn.setEditable(false);
    usuarioIn.setFont(new Font("Arial", 0, 36));
    usuarioIn.setOpaque(true);
    usuarioIn.setBackground(Color.GREEN);
    usuarioIn.setText("");

    String[] puestos = {"Cajero", "Supervisor", "Gerente", "Admin"};
    cargoIn = new JComboBox<>(puestos);
    cargoIn.setFont(new Font("Arial", 0, 20));

    this.teclado = new TecladoPass();

    this.panelSuperior.add(cargo);
    this.panelSuperior.add(usuario);
    this.panelSuperior.add(usuarioIn);
    this.panelSuperior.add(cargo);
    this.panelSuperior.add(cargoIn);
    this.add(panelSuperior);
    this.add(teclado);

    this.setVisible(true);
  }
Пример #28
0
  public void initializeComponents() {

    Font font;
    try {
      font = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream("images/Riffic.ttf"));
      Font styledAndSized = font.deriveFont(42F);
      hostLabel = new JLabel("Host");
      hostLabel.setFont(styledAndSized);
      portLabel = new JLabel("Port:");
      styledAndSized = font.deriveFont(28F);
      portLabel.setFont(styledAndSized);
      portTF = new JTextField(5);
      portTF.setFont(styledAndSized);

      portTF
          .getDocument()
          .addDocumentListener(
              new DocumentListener() {
                public void changedUpdate(DocumentEvent e) {
                  changed();
                }

                public void removeUpdate(DocumentEvent e) {
                  changed();
                }

                public void insertUpdate(DocumentEvent e) {
                  changed();
                }

                public void changed() {
                  if (portTF.getText().equals("")) {
                    submitButton.setEnabled(false);
                  } else {
                    submitButton.setEnabled(true);
                  }
                }
              });

      submitButton = new JButton("Submit");
      styledAndSized = font.deriveFont(20F);
      submitButton.setFont(styledAndSized);
      submitButton.setPreferredSize(new Dimension(200, 50));
      buttonPanel = new JPanel();
      hostPanel = new JPanel();

    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (FontFormatException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
 private void createTF(int totalLB) {
   al = new ArrayList<JTextField>();
   for (int i = 0; i < totalLB; i++) {
     tf = new JTextField(data[i]);
     tf.setFont(new Font("Sans Serif", 0, 12));
     //			tf.setBackground(new Color(0,0,0,0));
     al.add(tf);
   }
 }
Пример #30
0
  // CONSTRUCTOR
  public GUI_tabs_v1_1() {

    // TABS
    setTitle("QuequeAPP");
    JTabbedPane jtp = new JTabbedPane();
    getContentPane().add(jtp);

    // PANEL1
    JPanel envio = new JPanel();
    JLabel label1 = new JLabel();
    label1.setText("MY CONTACTS");
    envio.add(label1);

    // PANEL2
    JPanel jp2 = new JPanel();
    //        JLabel label2 = new JLabel();

    // fonte e botoes/texto
    Font fonte = new Font("Serif", Font.BOLD, 20);
    textoParaEnviar = new JTextField();
    textoParaEnviar.setSize(200, 200);
    textoParaEnviar.setFont(fonte);
    JButton botao = new JButton("Enviar");
    botao.setFont(fonte);
    botao.addActionListener(new EnviarListener());

    // area de recepcao de mensagens
    textoRecebido = new JTextArea();
    textoRecebido.setFont(fonte);
    JScrollPane scroll = new JScrollPane(textoRecebido);

    // PANEL3
    JPanel jp3 = new JPanel();
    jp3.setLayout(new GridLayout(2, 1));
    jp3.add(textoParaEnviar);
    jp3.add(botao);

    jp2.setLayout(new BorderLayout());
    jp2.add(BorderLayout.SOUTH, jp3);
    jp2.add(BorderLayout.CENTER, scroll);

    // ADD PANELS TO TABS
    jtp.addTab("CHAT", jp2);
    jtp.addTab("CONTACTS", envio);

    // configuracao de rede
    try {
      configurarRede();
    } catch (Exception e) {
      e.printStackTrace();
    }

    setSize(500, 500);
    setLocation(200, 200);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
  }