示例#1
0
 /**
  * Sets the JComponent that will be visible in the main window.
  *
  * @param component The new jComponent value
  */
 void setJComponent(JComponent component) {
   mainPanel.removeAll();
   if (component != null) {
     mainPanel.add(component, BorderLayout.CENTER);
   }
   getContentPane().validate();
   getContentPane().repaint();
 }
示例#2
0
  /** Create the main window subviews. */
  protected void makeContent() {
    messageTextField.setForeground(Color.red);

    JPanel centerPanel = new JPanel(new BorderLayout());
    centerPanel.add(mainPanel, BorderLayout.CENTER);

    JPanel tmpP = new JPanel(new BorderLayout());
    tmpP.add(messageTextField, BorderLayout.CENTER);
    tmpP.add(timePanel, BorderLayout.WEST);
    centerPanel.add(tmpP, BorderLayout.SOUTH);

    getContentPane().add(centerPanel, BorderLayout.CENTER);
  }
示例#3
0
 /**
  * Returns the name of the currently displaying JComponent.
  *
  * @return The name of the currently displaying JComponent.
  */
 String getComponentName() {
   return mainPanel.getComponent(0).getName();
 }
示例#4
0
 /**
  * Returns the currently displaying JComponent.
  *
  * @return The currently displaying JComponent.
  */
 JComponent getJComponent() {
   return (JComponent) mainPanel.getComponent(0);
 }
示例#5
0
 /**
  * Adds a time stamp text to the message field object
  *
  * @param time_txt The time stamp text
  */
 protected void addTimeStamp(JTextField time_txt) {
   timePanel.add(time_txt, BorderLayout.CENTER);
 }