@Override
    public Component getListCellRendererComponent(
        final JList list,
        final Object value,
        final int index,
        final boolean isSelected,
        final boolean cellHasFocus) {
      if (!(value instanceof WrappedLogRecord)) {
        return new JLabel();
      }

      final WrappedLogRecord wlr = (WrappedLogRecord) value;

      final JTextPane result = new JTextPane();
      result.setDragEnabled(true);
      result.setText(wlr.formatted);
      result.setComponentOrientation(list.getComponentOrientation());
      result.setFont(list.getFont());
      result.setBorder(cellHasFocus || isSelected ? SELECTED_BORDER : EMPTY_BORDER);

      if (wlr.record.getLevel() == Level.CONFIG) {
        result.setForeground(DARK_BLUE);
      }

      if (wlr.record.getLevel() == Level.SEVERE) {
        result.setBackground(DARK_RED);
        result.setForeground(Color.WHITE);
      }

      if (wlr.record.getLevel() == Level.WARNING) {
        result.setForeground(DARK_RED);
      }

      if (wlr.record.getLevel() == Level.FINE
          || wlr.record.getLevel() == Level.FINER
          || wlr.record.getLevel() == Level.FINEST) {
        result.setForeground(DARK_GREEN);
      }

      final Object[] parameters = wlr.record.getParameters();
      if (parameters != null) {
        for (final Object parameter : parameters) {
          if (parameter == null) {
            continue;
          }

          if (parameter instanceof Color) {
            result.setForeground((Color) parameter);
          } else if (parameter instanceof Font) {
            result.setFont((Font) parameter);
          }
        }
      }

      return result;
    }
Example #2
0
 private void updateDisplay() {
   // first, set block colours
   textView.setBackground(getColour(backgroundColour("text-background-colour")));
   textView.setForeground(getColour(foregroundColour("text-foreground-colour")));
   textView.setCaretColor(getColour(foregroundColour("text-caret-colour")));
   problemsView.setBackground(getColour(backgroundColour("problems-background-colour")));
   problemsView.setForeground(getColour(foregroundColour("problems-foreground-colour")));
   consoleView.setBackground(getColour(backgroundColour("console-background-colour")));
   consoleView.setForeground(getColour(foregroundColour("console-foreground-colour")));
   // second, set colours on the code!
   java.util.List<Lexer.Token> tokens = Lexer.tokenise(textView.getText(), true);
   int pos = 0;
   for (Lexer.Token t : tokens) {
     int len = t.toString().length();
     if (t instanceof Lexer.RightBrace || t instanceof Lexer.LeftBrace) {
       highlightArea(pos, len, foregroundColour("text-brace-colour"));
     } else if (t instanceof Lexer.Strung) {
       highlightArea(pos, len, foregroundColour("text-string-colour"));
     } else if (t instanceof Lexer.Comment) {
       highlightArea(pos, len, foregroundColour("text-comment-colour"));
     } else if (t instanceof Lexer.Quote) {
       highlightArea(pos, len, foregroundColour("text-quote-colour"));
     } else if (t instanceof Lexer.Comma) {
       highlightArea(pos, len, foregroundColour("text-comma-colour"));
     } else if (t instanceof Lexer.Identifier) {
       highlightArea(pos, len, foregroundColour("text-identifier-colour"));
     } else if (t instanceof Lexer.Integer) {
       highlightArea(pos, len, foregroundColour("text-integer-colour"));
     }
     pos += len;
   }
 }
  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);
  }
Example #4
0
  /**
   * Creates a new JTextPane for the code.
   *
   * @return the text pane
   */
  protected JTextPane newCodePane() {
    JTextPane result;
    SyntaxDocument doc;
    Properties props;

    try {
      props = Utils.readProperties(PROPERTIES_FILE);
    } catch (Exception e) {
      e.printStackTrace();
      props = new Properties();
    }

    result = new JTextPane();
    if (props.getProperty("Syntax", "false").equals("true")) {
      doc = new SyntaxDocument(props);
      result.setDocument(doc);
      result.setBackground(doc.getBackgroundColor());
    } else {
      result.setForeground(
          VisualizeUtils.processColour(props.getProperty("ForegroundColor", "black"), Color.BLACK));
      result.setBackground(
          VisualizeUtils.processColour(props.getProperty("BackgroundColor", "white"), Color.WHITE));
      result.setFont(
          new Font(
              props.getProperty("FontName", "monospaced"),
              Font.PLAIN,
              Integer.parseInt(props.getProperty("FontSize", "12"))));
    }

    return result;
  }
Example #5
0
  private JPanel createCentrePanel(YDataStateException exception) {
    JPanel centrePanel = new JPanel(new GridLayout(1, 2));

    JPanel msgPanel = new JPanel(new BorderLayout());
    msgPanel.setBackground(YAdminGUI._apiColour);
    msgPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(), "Schema for completing task"),
            BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    JTextPane msgTextPane = new JTextPane();
    msgTextPane.setContentType("text/plain");
    msgTextPane.setFont(new Font("courier", Font.PLAIN, 12));
    msgTextPane.setForeground(Color.RED);

    msgTextPane.setText(exception.getMessage());
    msgTextPane.setEditable(false);
    msgTextPane.setBackground(Color.LIGHT_GRAY);
    JPanel noWrapPanel = new JPanel();
    noWrapPanel.setLayout(new BorderLayout());
    noWrapPanel.add(msgTextPane);
    msgPanel.add(new JScrollPane(noWrapPanel));

    centrePanel.add(msgPanel, BorderLayout.NORTH);
    return centrePanel;
  }
 public void sendEmail() {
   String email = person.getEmail();
   errorMessage.setForeground(Color.blue);
   String recipientEmail = person.getEmail();
   String recipientName = person.getName();
   person.getUsername();
   person.getId();
   String newPassword = "";
   char[] newChar = new char[10];
   for (int i = 0; i < 10; i++) {
     newChar[i] = getRandomString(10).charAt(i);
     newPassword = newPassword + newChar[i];
     try {
       // if you generate more than 1 time, you must
       // put the process to sleep for awhile
       // otherwise it will return the same random
       // string
       Thread.sleep(100);
     } catch (InterruptedException d) {
       d.printStackTrace();
     }
   }
   if (sendEmail(
       "*****@*****.**", "oopjpass", recipientEmail, recipientName, newPassword)) {
     errorMessage.setText(
         errorMessage.getText() + "A replacement password has been sent to \n" + recipientEmail);
   } else {
     errorMessage.setText(errorMessage.getText() + "Sending failed.");
   }
   DesEncryption encryption = new DesEncryption("Password");
   inputPassword = encryption.encrypt(newPassword);
 }
Example #7
0
    @Override
    public void contentChanged() {
      super.contentChanged();

      htmlCommit.setForeground(getStyle().getBaseValues().getColor(Canvas.TEXT_COLOR_KEY));

      versionList.setForeground(getStyle().getBaseValues().getColor(Canvas.TEXT_COLOR_KEY));
    }
Example #8
0
  public LoginView() {

    // set head label Maybe it can be updated with a logo style image later.
    loginViewHeadLabel.setFont(new Font("arial", Font.BOLD, 18));
    loginViewHeadLabel.setForeground(new Color(143, 51, 32));
    loginViewHeadLabel.setText("E-COMMERCE for SME v0.01");
    // setting header jtextpane for information.
    loginViewTextPane.setFont(new Font("arial", Font.BOLD, 14));
    loginViewTextPane.setForeground(Color.RED);
    loginViewTextPane.setText("Kullanıcı adı ve parolanızı giriniz.");
  }
  public ConsoleWindow() {
    if (gui) {
      window = new JFrame("Package Tracking Console");
      window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      window.setSize((int) (screenSize.getWidth() / 4), (int) (screenSize.getHeight() / 1.5));
      window.setLocationRelativeTo(null);
      window.getContentPane().setLayout(new BorderLayout());

      menuBar = new JMenuBar();
      menuBar.add("test", new JLabel("Testing"));
      window.setJMenuBar(menuBar);

      StyleContext sc = new StyleContext();
      document = new DefaultStyledDocument(sc);

      // Styles

      send = sc.addStyle("(Send)", null);
      send.addAttribute(StyleConstants.Foreground, Color.CYAN);

      info = sc.addStyle("(Info)", null);
      info.addAttribute(StyleConstants.Foreground, Color.WHITE);

      warning = sc.addStyle("(Warning)", null);
      warning.addAttribute(StyleConstants.Foreground, Color.YELLOW);

      error = sc.addStyle("(Error)", null);
      error.addAttribute(StyleConstants.Foreground, Color.RED);
      error.addAttribute(StyleConstants.Bold, new Boolean(true));

      textArea = new JTextPane(document);
      textArea.setBackground(new Color(50, 50, 50));
      textArea.setEditable(true);
      textArea.setBorder(null);
      textArea.setForeground(Color.WHITE);

      scrollPane = new JScrollPane(textArea);
      new SmartScroller(scrollPane);

      window.getContentPane().add(scrollPane);

      input = new JTextField();
      input.setBackground(new Color(50, 50, 50));
      input.setForeground(Color.WHITE);
      input.setCaretColor(Color.WHITE);
      input.addActionListener(new test());
      window.getContentPane().add(input, BorderLayout.SOUTH);

      window.setVisible(true);
      info.addAttribute(StyleConstants.Foreground, Color.BLUE);
    }
  }
  /**
   * Create the panel.
   *
   * @throws Exception
   */
  private ExceptionPanel() {
    setLayout(new BorderLayout(0, 0));

    panelMessage = new JPanel();
    add(panelMessage, BorderLayout.NORTH);

    JButton btnEnlarge = new JButton("One or more exceptions occured. Click to show/hide.");
    btnEnlarge.setForeground(Color.RED);
    btnEnlarge.setOpaque(false);
    btnEnlarge.setContentAreaFilled(false);
    btnEnlarge.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            panelDetails.setVisible(!panelDetails.isVisible());
          }
        });
    panelMessage.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    panelMessage.add(btnEnlarge);

    JButton btnClose = new JButton("x");
    panelMessage.add(btnClose);
    btnClose.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            hideUs();
          }
        });

    panelDetails = new JPanel();
    add(panelDetails, BorderLayout.CENTER);
    panelDetails.setLayout(new BorderLayout(0, 0));

    textDetails = new JTextPane();
    textDetails.setForeground(Color.RED);
    scrollPane =
        new JScrollPane(
            textDetails,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    panelDetails.add(scrollPane);

    this.addComponentListener(
        new ComponentAdapter() {
          public void componentResized(ComponentEvent e) {
            Dimension d = new Dimension(THIS.getWidth(), 200);
            scrollPane.setPreferredSize(d);
          }
        });

    hideUs();
  }
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Windows Form
   * Designer. Otherwise, retrieving design might not work properly. Tip: If you must revise this
   * method, please backup this GUI file for JFrameBuilder to retrieve your design properly in
   * future, before revising this method.
   */
  private void initializeComponent() {
    jTextPane1 = new JTextPane();
    jButton1 = new JButton();
    jButton2 = new JButton();
    contentPane = (JPanel) this.getContentPane();

    //
    // jTextPane1
    //
    jTextPane1.setBackground(new Color(140, 152, 236));
    jTextPane1.setForeground(new Color(255, 0, 0));
    jTextPane1.setText(
        "                               \n                                                 NO DONUT FOR YOU\n                           SORRY FOR INCONVINIENCE FACED BY YOU\n                                    SEVER IS DOWN FOR A TIME BEING\n                                         PLEASE TRY AGAIN LATER");
    jTextPane1.setEditable(false);
    //
    // jButton1
    //
    jButton1.setText("Home");
    jButton1.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton1_actionPerformed(e);
          }
        });
    //
    // jButton2
    //
    jButton2.setText("Friends");
    jButton2.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton2_actionPerformed(e);
          }
        });
    //
    // contentPane
    //
    contentPane.setLayout(null);
    contentPane.setBackground(new Color(140, 152, 236));
    addComponent(contentPane, jTextPane1, 76, 165, 451, 150);
    addComponent(contentPane, jButton1, 94, 36, 83, 39);
    addComponent(contentPane, jButton2, 184, 36, 83, 39);
    //
    // serverdown
    //
    this.setTitle("serverdown - extends JFrame");
    this.setLocation(new Point(0, 0));
    this.setSize(new Dimension(1024, 768));
  }
Example #12
0
  private void updateFontColor() {
    Font mainFont = DrJava.getConfig().getSetting(OptionConstants.FONT_MAIN);
    Color backColor = DrJava.getConfig().getSetting(OptionConstants.DEFINITIONS_BACKGROUND_COLOR);
    Color fontColor = DrJava.getConfig().getSetting(OptionConstants.DEFINITIONS_NORMAL_COLOR);
    /* make it bigger */
    Font titleFont = mainFont.deriveFont((float) (mainFont.getSize() + 3));
    _antiAliasText = DrJava.getConfig().getSetting(OptionConstants.TEXT_ANTIALIAS).booleanValue();

    _label.setForeground(fontColor);
    _panel.setBackground(backColor);
    _label.setFont(titleFont);
    _textpane.setForeground(fontColor);
    _textpane.setFont(mainFont);
    ;
    _textpane.setBackground(backColor);
    _scroller.setBackground(backColor);
    _scroller.setBorder(new EmptyBorder(0, 0, 0, 0));
    _panel.setBorder(new LineBorder(fontColor, 1));
  }
Example #13
0
 public void clearError() {
   errorPane.setText(null);
   errorPane.setBackground(Color.WHITE);
   errorPane.setForeground(Color.BLACK);
   errorPane.setVisible(false);
 }
  /** Create the frame. */
  public LoginWindow() {
    setAutoRequestFocus(false);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 454, 488);
    contentPane = new JPanel();
    contentPane.setForeground(UIManager.getColor("ScrollBar.trackHighlightForeground"));
    contentPane.setBackground(UIManager.getColor("ScrollBar.track"));
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);

    JTextPane WelcomeMessage = new JTextPane();
    WelcomeMessage.setEditable(false);
    WelcomeMessage.setBackground(UIManager.getColor("Separator.highlight"));
    WelcomeMessage.setForeground(Color.DARK_GRAY);
    WelcomeMessage.setFont(new Font("Verdana", Font.BOLD, 11));
    WelcomeMessage.setText("\tWelcome to Neighborhood Information Center");

    JPanel panel = new JPanel();
    panel.setForeground(UIManager.getColor("TextPane.caretForeground"));
    panel.setBorder(new LineBorder(UIManager.getColor("TextField.background")));
    panel.setBackground(UIManager.getColor("TextField.disabledBackground"));

    JTextPane LoginMessage = new JTextPane();
    LoginMessage.setEditable(false);
    LoginMessage.setText("Please Login to Continue");
    LoginMessage.setForeground(SystemColor.controlText);
    LoginMessage.setFont(new Font("Verdana", Font.BOLD, 11));
    LoginMessage.setBackground(UIManager.getColor("TextField.disabledBackground"));

    LoginField = new JTextField();
    LoginField.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Login = LoginField.getText();
            System.out.println("\n Login-ID is : " + Login);
          }
        });
    LoginField.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {
            LoginField.setText("");
            LoginField.setForeground(Color.BLACK);
          }
        });
    LoginField.setBackground(UIManager.getColor("TextField.background"));
    LoginField.setForeground(SystemColor.scrollbar);
    LoginField.setText("Login ID");
    LoginField.setColumns(10);

    JButton LoginButton = new JButton("Login");
    LoginButton.addActionListener(
        new ActionListener() {
          @SuppressWarnings({})
          public void actionPerformed(ActionEvent arg0) {

            Login = LoginField.getText();
            System.out.println("\n Login-ID is : " + Login);

            Password = passwordField.getText();
            System.out.println("\n LOGIN BUTTON - Password is : " + Password);

            // ******************************************************************************
            // Set LoginField Back to Normal
            LoginField.setText("");
            LoginField.setBackground(UIManager.getColor("TextField.background"));
            LoginField.setForeground(SystemColor.scrollbar);
            LoginField.setText("Login ID");

            // Set PasswordField Back to Normal
            passwordField.setText("");
            passwordField.setBackground(UIManager.getColor("TextField.background"));
            passwordField.setForeground(SystemColor.scrollbar);
            char c = 0;
            passwordField.setEchoChar(c);
            passwordField.setText("Password");
            // *******************************************************************************

            int Valid = -99;

            try {
              int info = 1;
              Valid = database.getInfo(connection, Login, Password, info);
            } catch (SQLException e) {
              // TODO Auto-generated catch block
              System.out.printf("\n Failed to retrieve \n");
            }

            if (Valid > 0) {
              System.out.printf(" Successful in Login App. \n");
              frame.setVisible(false);
              userGUI program = new userGUI();
              // System.exit(0);
            } else {
              UnsuccessfulLogin fail = new UnsuccessfulLogin(Login);
              fail.NoSuccess(Login);
            }
          }
        });
    LoginButton.setBackground(new Color(102, 153, 255));

    JTextPane txtpnCreateAnAccount = new JTextPane();
    txtpnCreateAnAccount.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            CreateAccount newAcct = new CreateAccount();
            newAcct.account();
          }
        });
    txtpnCreateAnAccount.setEditable(false);
    txtpnCreateAnAccount.setText("Create an account");
    txtpnCreateAnAccount.setForeground(new Color(25, 25, 112));
    txtpnCreateAnAccount.setFont(new Font("Verdana", Font.BOLD, 11));
    txtpnCreateAnAccount.setBackground(SystemColor.menu);

    passwordField = new JPasswordField();

    // Setting Password as text
    passwordField.setBackground(UIManager.getColor("TextField.background"));
    passwordField.setForeground(SystemColor.scrollbar);
    passwordField.setText("Password");
    char c = 0;
    passwordField.setEchoChar(c);
    passwordField.setText("Password");

    // Done setting text

    passwordField.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {
            char c = 183;
            passwordField.setForeground(Color.black);
            passwordField.setEchoChar(c);
            passwordField.setText("");
          }
        });
    passwordField.setBackground(UIManager.getColor("TextField.background"));
    passwordField.setForeground(SystemColor.scrollbar);
    passwordField.setText("Password");
    passwordField.addActionListener(
        new ActionListener() {
          @SuppressWarnings("deprecation")
          public void actionPerformed(ActionEvent e) {

            Password = passwordField.getText();

            System.out.println("\n Password is : " + Password);
          }
        });
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(
        gl_panel
            .createParallelGroup(Alignment.TRAILING)
            .addGroup(
                gl_panel
                    .createSequentialGroup()
                    .addContainerGap(60, Short.MAX_VALUE)
                    .addGroup(
                        gl_panel
                            .createParallelGroup(Alignment.TRAILING)
                            .addGroup(
                                gl_panel
                                    .createSequentialGroup()
                                    .addComponent(
                                        txtpnCreateAnAccount,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addGap(63))
                            .addGroup(
                                gl_panel
                                    .createSequentialGroup()
                                    .addGroup(
                                        gl_panel
                                            .createParallelGroup(Alignment.TRAILING, false)
                                            .addComponent(
                                                LoginMessage,
                                                Alignment.LEADING,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                LoginButton,
                                                Alignment.LEADING,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                LoginField,
                                                Alignment.LEADING,
                                                GroupLayout.DEFAULT_SIZE,
                                                166,
                                                Short.MAX_VALUE)
                                            .addComponent(passwordField))
                                    .addGap(42)))));
    gl_panel.setVerticalGroup(
        gl_panel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_panel
                    .createSequentialGroup()
                    .addGap(30)
                    .addComponent(
                        LoginMessage,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                    .addGap(56)
                    .addComponent(
                        LoginField,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addComponent(
                        passwordField,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addComponent(LoginButton)
                    .addPreferredGap(ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
                    .addComponent(
                        txtpnCreateAnAccount,
                        GroupLayout.PREFERRED_SIZE,
                        21,
                        GroupLayout.PREFERRED_SIZE)
                    .addGap(47)));
    panel.setLayout(gl_panel);
    GroupLayout gl_contentPane = new GroupLayout(contentPane);
    gl_contentPane.setHorizontalGroup(
        gl_contentPane
            .createParallelGroup(Alignment.TRAILING)
            .addGroup(
                gl_contentPane
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        gl_contentPane
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                gl_contentPane
                                    .createSequentialGroup()
                                    .addComponent(
                                        WelcomeMessage,
                                        GroupLayout.DEFAULT_SIZE,
                                        418,
                                        Short.MAX_VALUE)
                                    .addGap(0))
                            .addGroup(
                                Alignment.TRAILING,
                                gl_contentPane
                                    .createSequentialGroup()
                                    .addComponent(
                                        panel,
                                        GroupLayout.PREFERRED_SIZE,
                                        270,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addGap(66)))));
    gl_contentPane.setVerticalGroup(
        gl_contentPane
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_contentPane
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        WelcomeMessage,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addComponent(
                        panel, GroupLayout.PREFERRED_SIZE, 342, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(48, Short.MAX_VALUE)));
    contentPane.setLayout(gl_contentPane);
  }
  /** Initialize the contents of the frame. */
  private void initialize() {
    JFrame frmEditdeleteAuciton = new JFrame();
    frmEditdeleteAuciton.setResizable(false);
    frmEditdeleteAuciton.setTitle("Edit/Delete Auciton");
    frmEditdeleteAuciton.setBounds(100, 100, 712, 467);
    frmEditdeleteAuciton.setLocationRelativeTo(null);
    frmEditdeleteAuciton.getContentPane().setLayout(null);
    frmEditdeleteAuciton.setLocationRelativeTo(null);
    frmEditdeleteAuciton.setVisible(true);

    JButton btnSearch = new JButton("SHOW AUCTIONS CREATED BY YOU");
    btnSearch.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            AuctionMethods.showmyauction(table);
          }
        });
    btnSearch.setFont(new Font("Tahoma", Font.PLAIN, 15));
    btnSearch.setBounds(170, 11, 346, 33);
    frmEditdeleteAuciton.getContentPane().add(btnSearch);

    textField_1 = new JTextField();
    textField_1.setColumns(10);
    textField_1.setBounds(164, 262, 166, 30);
    frmEditdeleteAuciton.getContentPane().add(textField_1);

    textField_2 = new JTextField();
    textField_2.setColumns(10);
    textField_2.setBounds(164, 302, 166, 30);
    frmEditdeleteAuciton.getContentPane().add(textField_2);

    textField_3 = new JTextField();
    textField_3.setColumns(10);
    textField_3.setBounds(164, 341, 166, 30);
    frmEditdeleteAuciton.getContentPane().add(textField_3);

    JLabel lblNewCategory = new JLabel("New Category");
    lblNewCategory.setFont(new Font("Tahoma", Font.PLAIN, 15));
    lblNewCategory.setBounds(10, 341, 144, 30);
    frmEditdeleteAuciton.getContentPane().add(lblNewCategory);

    JLabel lblNewStartingBid = new JLabel("New Starting Bid");
    lblNewStartingBid.setFont(new Font("Tahoma", Font.PLAIN, 15));
    lblNewStartingBid.setBounds(10, 302, 144, 28);
    frmEditdeleteAuciton.getContentPane().add(lblNewStartingBid);

    JLabel lblNewAuctionName = new JLabel("New Auction Name");
    lblNewAuctionName.setFont(new Font("Tahoma", Font.PLAIN, 15));
    lblNewAuctionName.setBounds(10, 262, 144, 29);
    frmEditdeleteAuciton.getContentPane().add(lblNewAuctionName);

    table = new JTable();
    table.setShowVerticalLines(false);
    table.setShowHorizontalLines(false);
    table.setShowGrid(false);
    table.setRowSelectionAllowed(false);
    table.setFont(new Font("Tahoma", Font.PLAIN, 12));
    table.setEnabled(false);
    table.setBounds(119, 76, 450, 82);
    frmEditdeleteAuciton.getContentPane().add(table);

    JTextPane txtpnAuctionName = new JTextPane();
    txtpnAuctionName.setText("Auction Name");
    txtpnAuctionName.setForeground(Color.WHITE);
    txtpnAuctionName.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtpnAuctionName.setEditable(false);
    txtpnAuctionName.setBackground(Color.DARK_GRAY);
    txtpnAuctionName.setBounds(119, 55, 150, 19);
    frmEditdeleteAuciton.getContentPane().add(txtpnAuctionName);

    JTextPane txtpnCategory = new JTextPane();
    txtpnCategory.setText("Category");
    txtpnCategory.setForeground(Color.WHITE);
    txtpnCategory.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtpnCategory.setEditable(false);
    txtpnCategory.setBackground(Color.DARK_GRAY);
    txtpnCategory.setBounds(269, 55, 150, 19);
    frmEditdeleteAuciton.getContentPane().add(txtpnCategory);

    JTextPane txtpnStaringBid = new JTextPane();
    txtpnStaringBid.setText("Staring Bid");
    txtpnStaringBid.setForeground(Color.WHITE);
    txtpnStaringBid.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtpnStaringBid.setEditable(false);
    txtpnStaringBid.setBackground(Color.DARK_GRAY);
    txtpnStaringBid.setBounds(419, 55, 150, 19);
    frmEditdeleteAuciton.getContentPane().add(txtpnStaringBid);

    JButton btnEdit = new JButton("EDIT");
    btnEdit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            String name = textField.getText();
            String newname = textField_1.getText();
            String bid = textField_2.getText();
            String category = textField_3.getText();
            AuctionMethods.editauction(name, newname, bid, category);

            frmEditdeleteAuciton.dispose();
          }
        });
    btnEdit.setFont(new Font("Tahoma", Font.PLAIN, 15));
    btnEdit.setBounds(93, 382, 137, 33);
    frmEditdeleteAuciton.getContentPane().add(btnEdit);

    JSeparator separator = new JSeparator();
    separator.setOrientation(SwingConstants.VERTICAL);
    separator.setBounds(340, 262, 38, 153);
    frmEditdeleteAuciton.getContentPane().add(separator);

    JLabel lblAreYouSure = new JLabel("Are you sure you want to delete the Auction?");
    lblAreYouSure.setHorizontalAlignment(SwingConstants.CENTER);
    lblAreYouSure.setFont(new Font("Tahoma", Font.PLAIN, 15));
    lblAreYouSure.setBounds(340, 262, 346, 33);
    frmEditdeleteAuciton.getContentPane().add(lblAreYouSure);

    JLabel label = new JLabel("This option CANNOT be undone!!");
    label.setHorizontalAlignment(SwingConstants.CENTER);
    label.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 16));
    label.setBounds(358, 322, 328, 31);
    frmEditdeleteAuciton.getContentPane().add(label);

    JButton button = new JButton("YES");
    button.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            String name = textField.getText();
            AuctionMethods.deleteauction(name);

            textField.setText(null);
          }
        });
    button.setFont(new Font("Tahoma", Font.BOLD, 20));
    button.setBounds(358, 364, 127, 51);
    frmEditdeleteAuciton.getContentPane().add(button);

    JButton button_1 = new JButton("NO");
    button_1.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            textField.setText(null);
          }
        });
    button_1.setFont(new Font("Tahoma", Font.BOLD, 20));
    button_1.setBounds(559, 364, 127, 51);
    frmEditdeleteAuciton.getContentPane().add(button_1);

    JSeparator separator_1 = new JSeparator();
    separator_1.setBounds(55, 169, 578, 19);
    frmEditdeleteAuciton.getContentPane().add(separator_1);

    JLabel lblEnterNameOf_1 = new JLabel("Enter name of Auction you want to edit or delete");
    lblEnterNameOf_1.setHorizontalAlignment(SwingConstants.CENTER);
    lblEnterNameOf_1.setFont(new Font("Tahoma", Font.PLAIN, 15));
    lblEnterNameOf_1.setBounds(91, 189, 328, 33);
    frmEditdeleteAuciton.getContentPane().add(lblEnterNameOf_1);

    textField = new JTextField();
    textField.setColumns(10);
    textField.setBounds(432, 189, 174, 33);
    frmEditdeleteAuciton.getContentPane().add(textField);
  }
  /** Initialize the contents of the frame. */
  private void initialize() {
    frame = new JFrame();
    frame.getContentPane().setBackground(Color.WHITE);
    frame.getContentPane().setForeground(Color.RED);
    frame.setBackground(Color.WHITE);
    frame.setBounds(100, 100, 613, 459);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(null);

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setForeground(Color.BLACK);
    tabbedPane.setBackground(Color.WHITE);
    tabbedPane.setBounds(1, 2, 596, 408);
    frame.getContentPane().add(tabbedPane);

    JPanel panel_1 = new JPanel();
    panel_1.setBackground(Color.WHITE);
    panel_1.setForeground(Color.GREEN);
    tabbedPane.addTab("Recieved Mail", null, panel_1, null);
    panel_1.setLayout(null);

    JTextPane textPane_1 = new JTextPane();
    textPane_1.setBackground(Color.WHITE);
    textPane_1.setForeground(Color.BLACK);
    textPane_1.setEditable(false);

    JScrollPane scrollPane1 = new JScrollPane(textPane_1);
    scrollPane1.setBounds(150, 100, 420, 250);
    panel_1.add(scrollPane1);

    // panel_1.add(textPane_1);

    DefaultListModel listModel = new DefaultListModel();
    File[] files1 = new File("src/inbox").listFiles();
    for (File file : files1) {
      if (file.isFile())
        listModel.addElement((file.getName()).substring(0, (file.getName()).length() - 4));
    }

    JList list = new JList(listModel);
    list.setForeground(Color.BLACK);
    list.setBackground(Color.WHITE);

    // list.setBounds(10, 11, 112, 280);
    // panel_1.add(list);

    JScrollPane scrollPane = new JScrollPane(list);
    // scrollPane.setViewportView(list);
    scrollPane.setBounds(20, 11, 112, 340);
    panel_1.add(scrollPane);

    JLabel lblMessage = new JLabel("Message");
    lblMessage.setForeground(Color.BLACK);
    lblMessage.setBounds(175, 77, 79, 14);
    panel_1.add(lblMessage);

    JPanel panel = new JPanel();
    panel.setBackground(Color.WHITE);
    tabbedPane.addTab("Send Email", null, panel, null);
    panel.setLayout(null);

    JComboBox contactCombo = new JComboBox();
    contactCombo.setForeground(Color.BLACK);
    contactCombo.setBackground(Color.WHITE);
    contactCombo.setBounds(172, 21, 409, 20);
    panel.add(contactCombo);

    JLabel label = new JLabel("Message:");
    label.setForeground(Color.BLACK);
    label.setBounds(13, 117, 91, 14);
    panel.add(label);

    JTextPane messagePane = new JTextPane();
    messagePane.setBackground(Color.WHITE);
    messagePane.setForeground(Color.BLACK);
    messagePane.setBounds(10, 124, 539, 194);
    // panel.add(messagePane);

    JButton button_1 = new JButton("Send");
    button_1.setForeground(Color.BLACK);
    button_1.setBackground(Color.WHITE);
    button_1.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            String to = contactCombo.getSelectedItem().toString();
            String subject = txtSubject.getText();
            Random rn = new Random();
            String ShareID = Integer.toString((new Random()).nextInt((999999999 - 100) + 1) + 100);
            System.out.println(ShareID);
            String from = "src/proxies/proxies.txt";
            String message = messagePane.getText();
            try {
              // if(selectedFileIn == true)
              System.out.println("sendmail1");
              SendMail.Distributor(to, ShareID, from, message, "", subject);
              System.out.println("sendmail2");
              // selectedFileIn = false;
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }
            messagePane.setText("");
            contactCombo.repaint();
            attField.setText("");
            attField.removeAll();
          }
        });

    JScrollPane sP =
        new JScrollPane(
            messagePane,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    sP.setBounds(13, 142, 568, 194);
    panel.add(sP);
    button_1.setBounds(482, 346, 99, 23);
    panel.add(button_1);

    JLabel lblTo = new JLabel("To");
    lblTo.setForeground(Color.BLACK);
    lblTo.setBackground(Color.BLACK);
    lblTo.setBounds(116, 24, 46, 14);
    panel.add(lblTo);

    attField = new JTextField();
    attField.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {}
        });
    attField.setBounds(172, 52, 409, 20);
    panel.add(attField);
    attField.setColumns(10);

    JButton btnSearchButton = new JButton("Search");
    btnSearchButton.setBackground(Color.WHITE);
    btnSearchButton.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.showOpenDialog(frame);
            // fileChooser.setCurrentDirectory(new File(System.getProperty("src/")));
            selectedFile = fileChooser.getSelectedFile();
            attField.setText(selectedFile.getName());
            selectedFileIn = true;
            // selectedFile = fileChooser.getSelectedFile();
          }
        });
    btnSearchButton.setBounds(73, 51, 89, 23);
    panel.add(btnSearchButton);

    txtSubject = new JTextField();
    txtSubject.setBounds(172, 83, 409, 20);
    panel.add(txtSubject);
    txtSubject.setColumns(10);

    JLabel lblSubject = new JLabel("Subject");
    lblSubject.setForeground(Color.BLACK);
    lblSubject.setBackground(Color.BLACK);
    lblSubject.setBounds(116, 85, 46, 14);
    panel.add(lblSubject);

    JPanel panel_2 = new JPanel();
    panel_2.setBackground(Color.WHITE);
    tabbedPane.addTab("Add Contact", null, panel_2, null);
    panel_2.setLayout(null);

    JLabel lblEmailAddress = new JLabel("Email Address");
    lblEmailAddress.setForeground(Color.BLACK);
    lblEmailAddress.setBounds(75, 159, 72, 14);
    panel_2.add(lblEmailAddress);

    JTextPane proxyPane = new JTextPane();
    proxyPane.setForeground(Color.BLACK);
    proxyPane.setBackground(Color.LIGHT_GRAY);
    proxyPane.setBounds(157, 159, 298, 102);
    panel_2.add(proxyPane);

    JLabel lblContactName = new JLabel("Contact Name");
    lblContactName.setForeground(Color.BLACK);
    lblContactName.setBounds(69, 124, 72, 14);
    panel_2.add(lblContactName);

    contactField = new JTextField();
    contactField.setBackground(Color.LIGHT_GRAY);
    contactField.setColumns(10);
    contactField.setBounds(157, 121, 298, 20);
    panel_2.add(contactField);

    JButton btnAddContact = new JButton("Add Contact");
    btnAddContact.setBackground(Color.WHITE);
    btnAddContact.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {
            BufferedWriter output = null;
            // Add new contact
            String conName = contactField.getText();
            String allprox = proxyPane.getText();
            File conFile = new File("src/contacts/" + conName + ".txt");
            try {
              output = new BufferedWriter(new FileWriter(conFile));
              output.write(allprox);
              output.close();
            } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
        });
    btnAddContact.setBounds(157, 301, 118, 23);
    panel_2.add(btnAddContact);

    // List<String> contacts = new ArrayList<String>();
    // comboBox.addItem("hg");
    File[] files = new File("src/contacts").listFiles();
    for (File file : files) {
      if (file.isFile())
        contactCombo.addItem((file.getName()).substring(0, (file.getName()).length() - 4));
    }
    list.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {
            String strbldr = "";
            String loc = "src/inbox/" + list.getSelectedValue().toString() + ".txt";
            try {
              BufferedReader buffread = new BufferedReader(new FileReader(loc));
              String line = buffread.readLine();
              while (line != null) {
                strbldr += line;
                strbldr += "\n";
                line = buffread.readLine();
              }
              buffread.close();
            } catch (Exception e) {
            }
            ;
            textPane_1.setText(strbldr);
            textPane_1.setCaretPosition(0);
          }
        });
    class Inner extends Thread {

      public void run() {

        do {
          System.out.println("Hello from a thread!");
          try {
            ReceiveMail.run();
            scrollPane.repaint();
            this.sleep(10000);
          } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        } while (true);
      }

      public void main(String args[]) {
        (new Inner()).start();
      }
    }
    Inner reloads = new Inner();
    reloads.start();
  }
  /**
   * Cria uma instância da janela de relatório de funcionário do sistema BVB
   *
   * @param janelaPai <code>Window</code> com a janela pai da caixa de diálogo <code>
   *     IgRelatorioFuncionario</code>
   * @see Window
   */
  public IgRelatorioFuncionario(Window janelaPai) {
    setModal(true);
    Color nephritis = new Color(39, 174, 96);

    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    setResizable(false);
    setTitle("BVB - Relat\u00F3rio de Funcion\u00E1rio");
    setBounds(100, 100, 690, 506);
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(null);

    JSeparator separatorTitulo = new JSeparator();
    separatorTitulo.setBounds(0, 69, 685, 2);
    contentPanel.add(separatorTitulo);

    JTextPane txtpnSubTitulo = new JTextPane();
    txtpnSubTitulo.setEditable(false);
    txtpnSubTitulo.setForeground(Color.WHITE);
    txtpnSubTitulo.setBackground(nephritis);
    txtpnSubTitulo.setText(
        "Insira o login do funcion\u00E1rio do qual deseja gerar o relat\u00F3rio de conex\u00F5es.");
    txtpnSubTitulo.setFont(new Font("Tahoma", Font.PLAIN, 12));
    txtpnSubTitulo.setBounds(20, 36, 420, 22);
    contentPanel.add(txtpnSubTitulo);

    JTextPane txtpnTitulo = new JTextPane();
    txtpnTitulo.setEditable(false);
    txtpnTitulo.setForeground(Color.WHITE);
    txtpnTitulo.setBackground(nephritis);
    txtpnTitulo.setText("Relat\u00F3rio de Funcion\u00E1rio");
    txtpnTitulo.setFont(new Font("Tahoma", Font.BOLD, 13));
    txtpnTitulo.setBounds(10, 11, 170, 22);
    contentPanel.add(txtpnTitulo);

    JLabel lblImg = new JLabel("Label Img");
    lblImg.setBorder(new LineBorder(Color.WHITE, 1, true));
    lblImg.setIcon(
        new ImageIcon(
            IgRelatorioFuncionario.class.getResource("/tsi/too/bvb/recursos/imagens/User-48.png")));
    lblImg.setBounds(624, 11, 48, 48);
    contentPanel.add(lblImg);

    JEditorPane dtrpnCampoTitulo = new JEditorPane();
    dtrpnCampoTitulo.setBackground(nephritis);
    dtrpnCampoTitulo.setEditable(false);
    dtrpnCampoTitulo.setBounds(0, 0, 685, 70);
    contentPanel.add(dtrpnCampoTitulo);

    JPanel panel = new JPanel();
    panel.setBounds(0, 435, 685, 43);
    contentPanel.add(panel);
    panel.setLayout(new FlowLayout(FlowLayout.RIGHT));

    btnCancelar = new JButton("Cancelar");
    btnCancelar.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            IgRelatorioFuncionario.this.dispose();
          }
        });

    btnGerarRelatorio = new JButton("Gerar Relat\u00F3rio");
    btnGerarRelatorio.setEnabled(false);
    btnGerarRelatorio.addActionListener(new TEActionRelatorioFuncionario(this));
    btnGerarRelatorio.setMnemonic(KeyEvent.VK_G);
    panel.add(btnGerarRelatorio);
    btnCancelar.setMnemonic(KeyEvent.VK_C);
    btnCancelar.setActionCommand("OK");
    panel.add(btnCancelar);

    JSeparator separatorBtn = new JSeparator();
    separatorBtn.setBounds(0, 424, 685, 2);
    contentPanel.add(separatorBtn);

    JPanel panelRelatorio = new JPanel();
    panelRelatorio.setBorder(
        new TitledBorder(
            new LineBorder(new Color(184, 207, 229)),
            "Relat\u00F3rio",
            TitledBorder.LEADING,
            TitledBorder.TOP,
            null,
            new Color(51, 153, 255)));
    panelRelatorio.setBounds(10, 127, 662, 285);
    contentPanel.add(panelRelatorio);
    panelRelatorio.setLayout(new BorderLayout(0, 0));

    JScrollPane relatorioScrollPane = new JScrollPane();
    relatorioScrollPane.setBorder(null);
    relatorioScrollPane.setHorizontalScrollBarPolicy(
        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    panelRelatorio.add(relatorioScrollPane, BorderLayout.CENTER);

    relatorioEditorPane = new JEditorPane();
    relatorioEditorPane.setFont(new Font("Arial", Font.BOLD, 14));
    relatorioEditorPane.setEditable(false);
    relatorioEditorPane.setBackground(new Color(238, 238, 238));
    relatorioScrollPane.setViewportView(relatorioEditorPane);

    JLabel lblLogin = new JLabel("Login:"******"insira o login do funcion\u00E1rio que deseja gerar o relat\u00F3rio, e clique em buscar");
    loginTextField.setColumns(10);
    loginTextField.setBounds(100, 92, 308, 20);
    contentPanel.add(loginTextField);

    btnAlterar = new JButton("Alterar");
    btnAlterar.addActionListener(new TEActionRelatorioFuncionario(this));
    btnAlterar.setVisible(false);

    btnBuscar = new JButton("Buscar");
    btnBuscar.addActionListener(new TEActionRelatorioFuncionario(this));
    btnBuscar.setMnemonic(KeyEvent.VK_B);
    btnBuscar.setBounds(418, 91, 89, 23);
    contentPanel.add(btnBuscar);
    btnAlterar.setMnemonic(KeyEvent.VK_A);
    btnAlterar.setBounds(418, 91, 89, 23);
    contentPanel.add(btnAlterar);

    setLocationRelativeTo(janelaPai);
    setVisible(true);
  }
  /**
   * Cria uma instância da janela de cadastro de funcionário do sistema BVB
   *
   * @param janelaPai <code>Window</code> com a janela pai da caixa de diálogo <code>
   *     IgCadFuncionario</code>
   * @param funcionario <code>Funcionario</code> referênte ao objeto onde os dados serão salvos
   * @see Window
   * @see Funcionario
   */
  public IgCadFuncionario(Window janelaPai, Funcionario funcionario) {
    setModal(true);
    Color nephritis = new Color(39, 174, 96);

    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    setResizable(false);
    setTitle("BVB - Cadastro de Funcion\u00E1rio");
    setBounds(100, 100, 523, (int) (506 * 0.85));
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JSeparator separatorBtn = new JSeparator();
    separatorBtn.setBounds(0, 348, 517, 2);
    contentPane.add(separatorBtn);

    JSeparator separatorTitulo = new JSeparator();
    separatorTitulo.setBounds(0, 69, 517, 2);
    contentPane.add(separatorTitulo);

    JTextPane txtpnSubTitulo = new JTextPane();
    txtpnSubTitulo.setEditable(false);
    txtpnSubTitulo.setForeground(Color.WHITE);
    txtpnSubTitulo.setBackground(nephritis);
    txtpnSubTitulo.setText("Insira o login e a senha do novo funcion\u00E1rio.");
    txtpnSubTitulo.setFont(new Font("Tahoma", Font.PLAIN, 12));
    txtpnSubTitulo.setBounds(20, 36, 290, 22);
    contentPane.add(txtpnSubTitulo);

    JTextPane txtpnTitulo = new JTextPane();
    txtpnTitulo.setEditable(false);
    txtpnTitulo.setForeground(Color.WHITE);
    txtpnTitulo.setBackground(nephritis);
    txtpnTitulo.setText("Cadastro de Funcion\u00E1rio");
    txtpnTitulo.setFont(new Font("Tahoma", Font.BOLD, 13));
    txtpnTitulo.setBounds(10, 11, 210, 22);
    contentPane.add(txtpnTitulo);

    JLabel lblImg = new JLabel("Label Img");
    lblImg.setBorder(new LineBorder(Color.WHITE, 1, true));
    lblImg.setIcon(
        new ImageIcon(
            IgCadFuncionario.class.getResource("/tsi/too/bvb/recursos/imagens/User-48.png")));
    lblImg.setBounds(459, 11, 48, 48);
    contentPane.add(lblImg);

    JEditorPane dtrpnCampoTitulo = new JEditorPane();
    dtrpnCampoTitulo.setBackground(nephritis);
    dtrpnCampoTitulo.setEditable(false);
    dtrpnCampoTitulo.setBounds(0, 0, 517, 70);
    contentPane.add(dtrpnCampoTitulo);

    JPanel Btnpanel = new JPanel();
    Btnpanel.setBounds(0, 359, 517, 43);
    contentPane.add(Btnpanel);
    Btnpanel.setLayout(new FlowLayout(FlowLayout.RIGHT));

    btnFinalizar = new JButton("Finalizar");
    btnFinalizar.addActionListener(new TEActionCadastrarFuncionario(this, funcionario));
    btnFinalizar.setMnemonic(KeyEvent.VK_F);
    Btnpanel.add(btnFinalizar);

    btnLimpar = new JButton("Limpar");
    btnLimpar.addActionListener(new TEActionCadastrarFuncionario(this, funcionario));
    btnLimpar.setMnemonic(KeyEvent.VK_L);
    Btnpanel.add(btnLimpar);

    btnCancelar = new JButton("Cancelar");
    btnCancelar.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            IgCadFuncionario.this.dispose();
          }
        });
    btnCancelar.setMnemonic(KeyEvent.VK_C);
    Btnpanel.add(btnCancelar);

    verificacaoPanel = new JPanel();
    verificacaoPanel.setLayout(null);
    verificacaoPanel.setBorder(
        new TitledBorder(
            UIManager.getBorder("TitledBorder.border"),
            "N\u00E3o Verificado",
            TitledBorder.LEADING,
            TitledBorder.TOP,
            null,
            new Color(0, 0, 255)));
    verificacaoPanel.setBounds(100, 95, 407, 58);
    contentPane.add(verificacaoPanel);

    loginTextField = new JTextField();
    loginTextField.setToolTipText(
        "este campo \u00E9 de preenchimento obrigat\u00F3rio, deve conter no m\u00EDnimo 6 e no m\u00E1ximo 20 caracteres (letras, d\u00EDgitos e os s\u00EDmbolos underscore (_) ou ponto (.)) e deve ser \u00FAnico");
    loginTextField.setColumns(10);
    loginTextField.setBounds(10, 20, 288, 20);
    verificacaoPanel.add(loginTextField);

    passwordField = new JPasswordField();
    passwordField.setToolTipText(
        "este campo \u00E9 de preenchimento obrigat\u00F3rio e deve conter no m\u00EDnimo 6 e no m\u00E1ximo 10 caracteres");
    passwordField.setBounds(100, 172, 308, 20);
    contentPane.add(passwordField);

    JPanel tipoUsuarioPanel = new JPanel();
    tipoUsuarioPanel.setLayout(null);
    tipoUsuarioPanel.setBorder(
        new TitledBorder(
            UIManager.getBorder("TitledBorder.border"),
            "Tipo do Usu\u00E1rio",
            TitledBorder.LEADING,
            TitledBorder.TOP,
            null,
            new Color(51, 153, 255)));
    tipoUsuarioPanel.setBounds(10, 235, 497, 58);
    contentPane.add(tipoUsuarioPanel);

    rdbtnAdministrador = new JRadioButton("Administrador");
    rdbtnAdministrador.setToolTipText("selecione se o funcion\u00E1rio for um administrador");
    buttonGroup.add(rdbtnAdministrador);
    rdbtnAdministrador.setSelected(true);
    rdbtnAdministrador.setMnemonic(KeyEvent.VK_A);
    rdbtnAdministrador.setBounds(10, 20, 108, 23);
    tipoUsuarioPanel.add(rdbtnAdministrador);

    rdbtnCaixa = new JRadioButton("Caixa");
    rdbtnCaixa.setToolTipText("selecione se o funcion\u00E1rio for um caixa");
    buttonGroup.add(rdbtnCaixa);
    rdbtnCaixa.setMnemonic(KeyEvent.VK_I);
    rdbtnCaixa.setBounds(120, 20, 58, 23);
    tipoUsuarioPanel.add(rdbtnCaixa);

    rdbtnGerente = new JRadioButton("Gerente");
    rdbtnGerente.setToolTipText("selecione se o funcion\u00E1rio for um gerente");
    buttonGroup.add(rdbtnGerente);
    rdbtnGerente.setMnemonic(KeyEvent.VK_G);
    rdbtnGerente.setBounds(220, 20, 72, 23);
    tipoUsuarioPanel.add(rdbtnGerente);

    JLabel lblLogin = new JLabel("Login:"******"Verificar");
    btnVerificar.addActionListener(new TEActionCadastrarFuncionario(this, funcionario));
    btnVerificar.setMnemonic(KeyEvent.VK_V);
    btnVerificar.setBounds(308, 19, 89, 23);
    verificacaoPanel.add(btnVerificar);
    lblLogin.setDisplayedMnemonic(KeyEvent.VK_O);
    lblLogin.setBounds(10, 115, 60, 14);
    contentPane.add(lblLogin);

    JLabel lblSenha = new JLabel("Senha:");
    lblSenha.setLabelFor(passwordField);
    lblSenha.setDisplayedMnemonic(KeyEvent.VK_S);
    lblSenha.setBounds(10, 175, 60, 14);
    contentPane.add(lblSenha);

    lblCamposErrados =
        new JLabel("* Os campos destacados de vermelho n\u00E3o foram preenchidos corretamente!");
    lblCamposErrados.setVisible(false);
    lblCamposErrados.setForeground(Color.RED);
    lblCamposErrados.setBounds(10, 323, 497, 14);
    contentPane.add(lblCamposErrados);

    JLabel lblRepetirSenha = new JLabel("Repita a Senha:");
    lblRepetirSenha.setDisplayedMnemonic(KeyEvent.VK_R);
    lblRepetirSenha.setBounds(10, 205, 90, 14);
    contentPane.add(lblRepetirSenha);

    rPasswordField = new JPasswordField();
    lblRepetirSenha.setLabelFor(rPasswordField);
    rPasswordField.setToolTipText(
        "este campo \u00E9 de preenchimento obrigat\u00F3rio e as senhas devem conferir");
    rPasswordField.setBounds(100, 204, 308, 20);
    contentPane.add(rPasswordField);

    setLocationRelativeTo(janelaPai);
    setVisible(true);
  }
Example #19
0
  public VictimGUI() {
    setToolTipText("Please enter information regarding the Alleged Victim.");
    // To configure JTextComponents
    filter = new DocumentSizeFilter(10);

    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] {800, 0};
    gridBagLayout.rowHeights = new int[] {223, 172, 161, 113, 0};
    gridBagLayout.columnWeights = new double[] {0.0, Double.MIN_VALUE};
    gridBagLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
    setLayout(gridBagLayout);

    VictimPanel = new JPanel();
    VictimPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));
    GridBagConstraints gbc_VictimPanel = new GridBagConstraints();
    gbc_VictimPanel.weighty = 0.3;
    gbc_VictimPanel.fill = GridBagConstraints.BOTH;
    gbc_VictimPanel.insets = new Insets(10, 10, 5, 10);
    gbc_VictimPanel.gridx = 0;
    gbc_VictimPanel.gridy = 0;
    add(VictimPanel, gbc_VictimPanel);
    GridBagLayout gbl_VictimPanel = new GridBagLayout();
    gbl_VictimPanel.columnWidths = new int[] {55, 0, 301, 109, 30, 302, 0};
    gbl_VictimPanel.rowHeights = new int[] {19, 21, 22, 20, 21, 21, 0};
    gbl_VictimPanel.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_VictimPanel.rowWeights = new double[] {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
    VictimPanel.setLayout(gbl_VictimPanel);

    addrNotSetWarning = new JTextPane();
    addrNotSetWarning.setVisible(false);

    allegedVictimLabel = new JLabel("Alleged Victim");
    allegedVictimLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
    GridBagConstraints gbc_allegedVictimLabel = new GridBagConstraints();
    gbc_allegedVictimLabel.anchor = GridBagConstraints.NORTHWEST;
    gbc_allegedVictimLabel.insets = topInsetBumper;
    gbc_allegedVictimLabel.gridx = 0;
    gbc_allegedVictimLabel.gridy = 0;
    VictimPanel.add(allegedVictimLabel, gbc_allegedVictimLabel);

    firstNameLabel = new JLabel("First Name:");
    GridBagConstraints gbc_firstNameLabel = new GridBagConstraints();
    gbc_firstNameLabel.anchor = GridBagConstraints.NORTHEAST;
    gbc_firstNameLabel.insets = leftInsetBumper;
    gbc_firstNameLabel.gridx = 0;
    gbc_firstNameLabel.gridy = 1;
    VictimPanel.add(firstNameLabel, gbc_firstNameLabel);

    firstNameNotSetWarning = new JTextPane();
    firstNameNotSetWarning.setVisible(false);
    firstNameNotSetWarning.setEditable(false);
    firstNameNotSetWarning.setFont(new Font("Tahoma", Font.PLAIN, 12));
    firstNameNotSetWarning.setForeground(Color.RED);
    firstNameNotSetWarning.setText("*");
    firstNameNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_firstNameNotSetWarning = new GridBagConstraints();
    gbc_firstNameNotSetWarning.anchor = GridBagConstraints.NORTHWEST;
    gbc_firstNameNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_firstNameNotSetWarning.gridx = 1;
    gbc_firstNameNotSetWarning.gridy = 1;
    VictimPanel.add(firstNameNotSetWarning, gbc_firstNameNotSetWarning);

    firstNameText = new JFormattedTextField();
    filter.setupTextField(firstNameText, DocumentSizeFilter.CHAR, 20);
    filter.setupTextField(firstNameText, DocumentSizeFilter.CHAR, 20);
    GridBagConstraints gbc_firstNameText = new GridBagConstraints();
    gbc_firstNameText.anchor = GridBagConstraints.NORTH;
    gbc_firstNameText.fill = GridBagConstraints.HORIZONTAL;
    gbc_firstNameText.insets = new Insets(0, 0, 5, 5);
    gbc_firstNameText.gridx = 2;
    gbc_firstNameText.gridy = 1;
    VictimPanel.add(firstNameText, gbc_firstNameText);

    lastNameLabel = new JLabel("Last Name:");
    GridBagConstraints gbc_lastNameLabel = new GridBagConstraints();
    gbc_lastNameLabel.weightx = 0.1;
    gbc_lastNameLabel.anchor = GridBagConstraints.EAST;
    gbc_lastNameLabel.insets = new Insets(0, 0, 5, 5);
    gbc_lastNameLabel.gridx = 3;
    gbc_lastNameLabel.gridy = 1;
    VictimPanel.add(lastNameLabel, gbc_lastNameLabel);

    lastNameNotSetWarning = new JTextPane();
    lastNameNotSetWarning.setVisible(false);
    lastNameNotSetWarning.setText("*");
    lastNameNotSetWarning.setForeground(Color.RED);
    lastNameNotSetWarning.setEditable(false);
    lastNameNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_lastNameNotSetWarning = new GridBagConstraints();
    gbc_lastNameNotSetWarning.anchor = GridBagConstraints.NORTHWEST;
    gbc_lastNameNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_lastNameNotSetWarning.gridx = 4;
    gbc_lastNameNotSetWarning.gridy = 1;
    VictimPanel.add(lastNameNotSetWarning, gbc_lastNameNotSetWarning);

    lastNameText = new JFormattedTextField();
    GridBagConstraints gbc_lastNameText = new GridBagConstraints();
    gbc_lastNameText.weightx = 0.8;
    gbc_lastNameText.anchor = GridBagConstraints.NORTH;
    gbc_lastNameText.fill = GridBagConstraints.HORIZONTAL;
    gbc_lastNameText.insets = new Insets(0, 0, 5, 10);
    gbc_lastNameText.gridx = 5;
    gbc_lastNameText.gridy = 1;
    VictimPanel.add(lastNameText, gbc_lastNameText);

    addressLabel = new JLabel("Address:");
    GridBagConstraints gbc_addressLabel = new GridBagConstraints();
    gbc_addressLabel.anchor = GridBagConstraints.NORTHEAST;
    gbc_addressLabel.insets = leftInsetBumper;
    gbc_addressLabel.gridx = 0;
    gbc_addressLabel.gridy = 2;
    VictimPanel.add(addressLabel, gbc_addressLabel);
    addrNotSetWarning.setEditable(false);
    addrNotSetWarning.setText("*");
    addrNotSetWarning.setForeground(Color.RED);
    addrNotSetWarning.setFont(new Font("Tahoma", Font.PLAIN, 12));
    addrNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_addrNotSetWarning = new GridBagConstraints();
    gbc_addrNotSetWarning.anchor = GridBagConstraints.SOUTHWEST;
    gbc_addrNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_addrNotSetWarning.gridx = 1;
    gbc_addrNotSetWarning.gridy = 2;
    VictimPanel.add(addrNotSetWarning, gbc_addrNotSetWarning);

    addressTextArea = new JTextArea();
    addressTextArea.setWrapStyleWord(true);
    addressTextArea.setLineWrap(true);
    GridBagConstraints gbc_addressTextArea = new GridBagConstraints();
    gbc_addressTextArea.fill = GridBagConstraints.BOTH;
    gbc_addressTextArea.insets = new Insets(0, 0, 5, 5);
    gbc_addressTextArea.gridheight = 2;
    gbc_addressTextArea.gridx = 2;
    gbc_addressTextArea.gridy = 2;
    VictimPanel.add(addressTextArea, gbc_addressTextArea);

    sexLabel = new JLabel("Sex:");
    GridBagConstraints gbc_sexLabel = new GridBagConstraints();
    gbc_sexLabel.anchor = GridBagConstraints.NORTHEAST;
    gbc_sexLabel.insets = new Insets(0, 0, 5, 5);
    gbc_sexLabel.gridx = 3;
    gbc_sexLabel.gridy = 2;
    VictimPanel.add(sexLabel, gbc_sexLabel);

    sexNotSetWarning = new JTextPane();
    sexNotSetWarning.setEditable(false);
    sexNotSetWarning.setVisible(false);
    sexNotSetWarning.setText("*");
    sexNotSetWarning.setForeground(Color.RED);
    sexNotSetWarning.setFont(new Font("Tahoma", Font.PLAIN, 12));
    sexNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_sexNotSetWarning = new GridBagConstraints();
    gbc_sexNotSetWarning.anchor = GridBagConstraints.SOUTHWEST;
    gbc_sexNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_sexNotSetWarning.gridx = 4;
    gbc_sexNotSetWarning.gridy = 2;
    VictimPanel.add(sexNotSetWarning, gbc_sexNotSetWarning);

    sexCombo = new JComboBox();
    sexCombo.setModel(new DefaultComboBoxModel(comboSelectable));
    GridBagConstraints gbc_sexCombo = new GridBagConstraints();
    gbc_sexCombo.anchor = GridBagConstraints.NORTH;
    gbc_sexCombo.fill = GridBagConstraints.HORIZONTAL;
    gbc_sexCombo.insets = new Insets(0, 0, 5, 10);
    gbc_sexCombo.gridx = 5;
    gbc_sexCombo.gridy = 2;
    VictimPanel.add(sexCombo, gbc_sexCombo);

    lblTelephone = new JLabel("Telephone");
    GridBagConstraints gbc_lblTelephone = new GridBagConstraints();
    gbc_lblTelephone.anchor = GridBagConstraints.SOUTHEAST;
    gbc_lblTelephone.insets = new Insets(0, 0, 5, 5);
    gbc_lblTelephone.gridx = 3;
    gbc_lblTelephone.gridy = 3;
    VictimPanel.add(lblTelephone, gbc_lblTelephone);

    phoneNotSetWarning = new JTextPane();
    phoneNotSetWarning.setVisible(false);
    phoneNotSetWarning.setForeground(Color.RED);
    phoneNotSetWarning.setEditable(false);
    phoneNotSetWarning.setBackground(SystemColor.menu);
    phoneNotSetWarning.setText("*");
    GridBagConstraints gbc_phoneNotSetWarning = new GridBagConstraints();
    gbc_phoneNotSetWarning.anchor = GridBagConstraints.SOUTHWEST;
    gbc_phoneNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_phoneNotSetWarning.gridx = 4;
    gbc_phoneNotSetWarning.gridy = 3;
    VictimPanel.add(phoneNotSetWarning, gbc_phoneNotSetWarning);

    panel_1 = new JPanel();
    GridBagConstraints gbc_panel_1 = new GridBagConstraints();
    gbc_panel_1.anchor = GridBagConstraints.SOUTH;
    gbc_panel_1.insets = new Insets(0, 0, 5, 10);
    gbc_panel_1.fill = GridBagConstraints.HORIZONTAL;
    gbc_panel_1.gridx = 5;
    gbc_panel_1.gridy = 3;
    VictimPanel.add(panel_1, gbc_panel_1);
    GridBagLayout gbl_panel_1 = new GridBagLayout();
    gbl_panel_1.columnWidths = new int[] {0, 0, 0, 0};
    gbl_panel_1.rowHeights = new int[] {0, 0};
    gbl_panel_1.columnWeights = new double[] {0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_panel_1.rowWeights = new double[] {0.0, Double.MIN_VALUE};
    panel_1.setLayout(gbl_panel_1);
    phoneAreaCode = new JFormattedTextField();
    GridBagConstraints gbc_phoneAreaCode = new GridBagConstraints();
    gbc_phoneAreaCode.fill = GridBagConstraints.BOTH;
    gbc_phoneAreaCode.weightx = 0.2;
    gbc_phoneAreaCode.insets = new Insets(0, 0, 0, 5);
    gbc_phoneAreaCode.gridx = 0;
    gbc_phoneAreaCode.gridy = 0;
    panel_1.add(phoneAreaCode, gbc_phoneAreaCode);
    filter.setupTextField(phoneAreaCode, DocumentSizeFilter.NO, 3);
    phoneFirstThree = new JFormattedTextField();
    GridBagConstraints gbc_phoneFirstThree = new GridBagConstraints();
    gbc_phoneFirstThree.fill = GridBagConstraints.BOTH;
    gbc_phoneFirstThree.weightx = 0.2;
    gbc_phoneFirstThree.insets = new Insets(0, 0, 0, 5);
    gbc_phoneFirstThree.gridx = 1;
    gbc_phoneFirstThree.gridy = 0;
    panel_1.add(phoneFirstThree, gbc_phoneFirstThree);
    filter.setupTextField(phoneFirstThree, DocumentSizeFilter.NO, 3);
    phoneLastFour = new JFormattedTextField();
    GridBagConstraints gbc_phoneLastFour = new GridBagConstraints();
    gbc_phoneLastFour.fill = GridBagConstraints.BOTH;
    gbc_phoneLastFour.weightx = 0.4;
    gbc_phoneLastFour.gridx = 2;
    gbc_phoneLastFour.gridy = 0;
    panel_1.add(phoneLastFour, gbc_phoneLastFour);
    filter.setupTextField(phoneLastFour, DocumentSizeFilter.NO, 4);

    dobLabel = new JLabel("DOB: ");
    GridBagConstraints gbc_dobLabel = new GridBagConstraints();
    gbc_dobLabel.weighty = 1.0;
    gbc_dobLabel.anchor = GridBagConstraints.EAST;
    gbc_dobLabel.insets = leftInsetBumper;
    gbc_dobLabel.gridx = 0;
    gbc_dobLabel.gridy = 4;
    VictimPanel.add(dobLabel, gbc_dobLabel);

    dobNotSetWarning = new JTextPane();
    dobNotSetWarning.setVisible(false);
    dobNotSetWarning.setEditable(false);
    dobNotSetWarning.setText("*");
    dobNotSetWarning.setForeground(Color.RED);
    dobNotSetWarning.setFont(new Font("Tahoma", Font.PLAIN, 12));
    dobNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_dobNotSetWarning = new GridBagConstraints();
    gbc_dobNotSetWarning.anchor = GridBagConstraints.WEST;
    gbc_dobNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_dobNotSetWarning.gridx = 1;
    gbc_dobNotSetWarning.gridy = 4;
    VictimPanel.add(dobNotSetWarning, gbc_dobNotSetWarning);

    panel = new JPanel();
    GridBagConstraints gbc_panel = new GridBagConstraints();
    gbc_panel.insets = new Insets(0, 0, 5, 5);
    gbc_panel.fill = GridBagConstraints.HORIZONTAL;
    gbc_panel.gridx = 2;
    gbc_panel.gridy = 4;
    VictimPanel.add(panel, gbc_panel);
    GridBagLayout gbl_panel = new GridBagLayout();
    gbl_panel.columnWidths = new int[] {0, 0, 0, 0};
    gbl_panel.rowHeights = new int[] {0, 0};
    gbl_panel.columnWeights = new double[] {0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_panel.rowWeights = new double[] {0.0, Double.MIN_VALUE};
    panel.setLayout(gbl_panel);

    dayText = new JTextField();
    GridBagConstraints gbc_dayText = new GridBagConstraints();
    gbc_dayText.fill = GridBagConstraints.BOTH;
    gbc_dayText.weightx = 0.2;
    gbc_dayText.insets = new Insets(0, 0, 0, 5);
    gbc_dayText.gridx = 0;
    gbc_dayText.gridy = 0;
    panel.add(dayText, gbc_dayText);
    dayText.setText("DD");
    dayText.setColumns(10);
    filter.setupTextField(dayText, DocumentSizeFilter.NO, 2);

    monthText = new JTextField();
    GridBagConstraints gbc_monthText = new GridBagConstraints();
    gbc_monthText.fill = GridBagConstraints.BOTH;
    gbc_monthText.weightx = 0.2;
    gbc_monthText.insets = new Insets(0, 0, 0, 5);
    gbc_monthText.gridx = 1;
    gbc_monthText.gridy = 0;
    panel.add(monthText, gbc_monthText);
    monthText.setText("MM");
    monthText.setColumns(10);
    filter.setupTextField(monthText, DocumentSizeFilter.NO, 2);

    yearText = new JTextField();
    GridBagConstraints gbc_yearText = new GridBagConstraints();
    gbc_yearText.fill = GridBagConstraints.BOTH;
    gbc_yearText.weightx = 0.4;
    gbc_yearText.gridx = 2;
    gbc_yearText.gridy = 0;
    panel.add(yearText, gbc_yearText);
    yearText.setText("YYYY");
    yearText.setColumns(10);
    filter.setupTextField(yearText, DocumentSizeFilter.NO, 4);

    ageLabel = new JLabel("Age:");
    GridBagConstraints gbc_ageLabel = new GridBagConstraints();
    gbc_ageLabel.anchor = GridBagConstraints.EAST;
    gbc_ageLabel.insets = new Insets(0, 0, 5, 5);
    gbc_ageLabel.gridx = 3;
    gbc_ageLabel.gridy = 4;
    VictimPanel.add(ageLabel, gbc_ageLabel);

    ageNotSetWarning = new JTextPane();
    ageNotSetWarning.setVisible(false);
    ageNotSetWarning.setEditable(false);
    ageNotSetWarning.setText("*");
    ageNotSetWarning.setForeground(Color.RED);
    ageNotSetWarning.setFont(new Font("Tahoma", Font.PLAIN, 12));
    ageNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_ageNotSetWarning = new GridBagConstraints();
    gbc_ageNotSetWarning.anchor = GridBagConstraints.WEST;
    gbc_ageNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_ageNotSetWarning.gridx = 4;
    gbc_ageNotSetWarning.gridy = 4;
    VictimPanel.add(ageNotSetWarning, gbc_ageNotSetWarning);

    ageText = new JTextField();
    ageText.setColumns(10);
    filter.setupTextField(ageText, DocumentSizeFilter.NO, 3);
    GridBagConstraints gbc_ageText = new GridBagConstraints();
    gbc_ageText.fill = GridBagConstraints.HORIZONTAL;
    gbc_ageText.insets = new Insets(0, 0, 5, 10);
    gbc_ageText.gridx = 5;
    gbc_ageText.gridy = 4;
    VictimPanel.add(ageText, gbc_ageText);

    maritalStatusLabel = new JLabel("Marital Status:");
    GridBagConstraints gbc_maritalStatusLabel = new GridBagConstraints();
    gbc_maritalStatusLabel.anchor = GridBagConstraints.NORTHEAST;
    gbc_maritalStatusLabel.insets = new Insets(5, 10, 15, 5);
    gbc_maritalStatusLabel.gridx = 0;
    gbc_maritalStatusLabel.gridy = 5;
    VictimPanel.add(maritalStatusLabel, gbc_maritalStatusLabel);

    maritalStatusNotSetWarning = new JTextPane();
    maritalStatusNotSetWarning.setEditable(false);
    maritalStatusNotSetWarning.setVisible(false);
    maritalStatusNotSetWarning.setText("*");
    maritalStatusNotSetWarning.setForeground(Color.RED);
    maritalStatusNotSetWarning.setFont(new Font("Tahoma", Font.PLAIN, 12));
    maritalStatusNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_maritalStatusNotSetWarning = new GridBagConstraints();
    gbc_maritalStatusNotSetWarning.anchor = GridBagConstraints.NORTHWEST;
    gbc_maritalStatusNotSetWarning.insets = new Insets(0, 0, 0, 5);
    gbc_maritalStatusNotSetWarning.gridx = 1;
    gbc_maritalStatusNotSetWarning.gridy = 5;
    VictimPanel.add(maritalStatusNotSetWarning, gbc_maritalStatusNotSetWarning);

    maritalStatusText = new JTextField();
    maritalStatusText.setColumns(10);
    filter.setupTextField(maritalStatusText, DocumentSizeFilter.CHAR, 10);
    GridBagConstraints gbc_maritalStatusText = new GridBagConstraints();
    gbc_maritalStatusText.insets = new Insets(0, 0, 0, 5);
    gbc_maritalStatusText.anchor = GridBagConstraints.NORTH;
    gbc_maritalStatusText.fill = GridBagConstraints.HORIZONTAL;
    gbc_maritalStatusText.gridx = 2;
    gbc_maritalStatusText.gridy = 5;
    VictimPanel.add(maritalStatusText, gbc_maritalStatusText);

    DisabilityPanel = new JPanel();
    DisabilityPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));
    GridBagConstraints gbc_DisabilityPanel = new GridBagConstraints();
    gbc_DisabilityPanel.weightx = 1.0;
    gbc_DisabilityPanel.weighty = 0.1;
    gbc_DisabilityPanel.fill = GridBagConstraints.BOTH;
    gbc_DisabilityPanel.insets = new Insets(0, 10, 5, 10);
    gbc_DisabilityPanel.gridx = 0;
    gbc_DisabilityPanel.gridy = 1;
    add(DisabilityPanel, gbc_DisabilityPanel);
    GridBagLayout gbl_DisabilityPanel = new GridBagLayout();
    gbl_DisabilityPanel.columnWidths = new int[] {210, 0, 471, 0};
    gbl_DisabilityPanel.rowHeights = new int[] {22, 125, 0};
    gbl_DisabilityPanel.columnWeights = new double[] {0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_DisabilityPanel.rowWeights = new double[] {0.0, 0.0, Double.MIN_VALUE};
    DisabilityPanel.setLayout(gbl_DisabilityPanel);

    disabilityLabel = new JLabel("Disability: (check as apply)");
    disabilityLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
    GridBagConstraints gbc_disabilityLabel = new GridBagConstraints();
    gbc_disabilityLabel.anchor = GridBagConstraints.SOUTHWEST;
    gbc_disabilityLabel.insets = topInsetBumper;
    gbc_disabilityLabel.gridx = 0;
    gbc_disabilityLabel.gridy = 0;
    DisabilityPanel.add(disabilityLabel, gbc_disabilityLabel);

    disabilityNotSetWarning = new JTextPane();
    disabilityNotSetWarning.setVisible(false);
    disabilityNotSetWarning.setEditable(false);
    disabilityNotSetWarning.setForeground(Color.RED);
    disabilityNotSetWarning.setText("*");
    disabilityNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_disabilityNotSetWarning = new GridBagConstraints();
    gbc_disabilityNotSetWarning.anchor = GridBagConstraints.NORTHWEST;
    gbc_disabilityNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_disabilityNotSetWarning.gridx = 1;
    gbc_disabilityNotSetWarning.gridy = 0;
    DisabilityPanel.add(disabilityNotSetWarning, gbc_disabilityNotSetWarning);

    disabilityCbPanel = new JPanel();
    GridBagLayout gbl_disabilityCbPanel = new GridBagLayout();
    gbl_disabilityCbPanel.columnWidths = new int[] {100, 100, 100, 90};
    gbl_disabilityCbPanel.rowHeights = new int[] {20, 20, 20, 20};
    gbl_disabilityCbPanel.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0};
    gbl_disabilityCbPanel.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0};
    disabilityCbPanel.setLayout(gbl_disabilityCbPanel);

    chckbxMentalRetardation = new JCheckBox("Mental Retardation");
    GridBagConstraints gbc_chckbxMentalRetardation = new GridBagConstraints();
    gbc_chckbxMentalRetardation.anchor = GridBagConstraints.WEST;
    gbc_chckbxMentalRetardation.insets = new Insets(0, 0, 5, 5);
    gbc_chckbxMentalRetardation.gridx = 0;
    gbc_chckbxMentalRetardation.gridy = 0;
    disabilityCbPanel.add(chckbxMentalRetardation, gbc_chckbxMentalRetardation);

    chckbxMobility = new JCheckBox("Mobility");
    GridBagConstraints gbc_chckbxMobility = new GridBagConstraints();
    gbc_chckbxMobility.anchor = GridBagConstraints.WEST;
    gbc_chckbxMobility.fill = GridBagConstraints.VERTICAL;
    gbc_chckbxMobility.insets = new Insets(0, 0, 5, 5);
    gbc_chckbxMobility.gridx = 2;
    gbc_chckbxMobility.gridy = 0;
    disabilityCbPanel.add(chckbxMobility, gbc_chckbxMobility);

    chckbxVisual = new JCheckBox("Visual");
    GridBagConstraints gbc_chckbxVisual = new GridBagConstraints();
    gbc_chckbxVisual.anchor = GridBagConstraints.WEST;
    gbc_chckbxVisual.fill = GridBagConstraints.VERTICAL;
    gbc_chckbxVisual.insets = new Insets(0, 0, 5, 0);
    gbc_chckbxVisual.gridx = 4;
    gbc_chckbxVisual.gridy = 0;
    disabilityCbPanel.add(chckbxVisual, gbc_chckbxVisual);
    chckbxMultipleSclerosis = new JCheckBox("Multiple Sclerosis");
    GridBagConstraints gbc_chckbxMultipleSclerosis = new GridBagConstraints();
    gbc_chckbxMultipleSclerosis.anchor = GridBagConstraints.WEST;
    gbc_chckbxMultipleSclerosis.insets = new Insets(0, 0, 5, 5);
    gbc_chckbxMultipleSclerosis.gridx = 0;
    gbc_chckbxMultipleSclerosis.gridy = 1;
    disabilityCbPanel.add(chckbxMultipleSclerosis, gbc_chckbxMultipleSclerosis);
    chckbxMentalIllness = new JCheckBox("Mental Illness");
    GridBagConstraints gbc_chckbxMentalIllness = new GridBagConstraints();
    gbc_chckbxMentalIllness.anchor = GridBagConstraints.WEST;
    gbc_chckbxMentalIllness.fill = GridBagConstraints.VERTICAL;
    gbc_chckbxMentalIllness.insets = new Insets(0, 0, 5, 5);
    gbc_chckbxMentalIllness.gridx = 2;
    gbc_chckbxMentalIllness.gridy = 1;
    disabilityCbPanel.add(chckbxMentalIllness, gbc_chckbxMentalIllness);
    chckbxDeafHard = new JCheckBox("Deaf / Hard of Hearing");
    GridBagConstraints gbc_chckbxDeafHard = new GridBagConstraints();
    gbc_chckbxDeafHard.anchor = GridBagConstraints.WEST;
    gbc_chckbxDeafHard.fill = GridBagConstraints.VERTICAL;
    gbc_chckbxDeafHard.insets = new Insets(0, 0, 5, 0);
    gbc_chckbxDeafHard.gridx = 4;
    gbc_chckbxDeafHard.gridy = 1;
    disabilityCbPanel.add(chckbxDeafHard, gbc_chckbxDeafHard);
    chckbxCerebralPalsy = new JCheckBox("Cerebral Palsy");
    GridBagConstraints gbc_chckbxCerebralPalsy = new GridBagConstraints();
    gbc_chckbxCerebralPalsy.anchor = GridBagConstraints.WEST;
    gbc_chckbxCerebralPalsy.insets = new Insets(0, 0, 5, 5);
    gbc_chckbxCerebralPalsy.gridx = 0;
    gbc_chckbxCerebralPalsy.gridy = 2;
    disabilityCbPanel.add(chckbxCerebralPalsy, gbc_chckbxCerebralPalsy);
    chckbxHeadInjury = new JCheckBox("Head Injury");
    GridBagConstraints gbc_chckbxHeadInjury = new GridBagConstraints();
    gbc_chckbxHeadInjury.anchor = GridBagConstraints.WEST;
    gbc_chckbxHeadInjury.fill = GridBagConstraints.VERTICAL;
    gbc_chckbxHeadInjury.insets = new Insets(0, 0, 5, 5);
    gbc_chckbxHeadInjury.gridx = 2;
    gbc_chckbxHeadInjury.gridy = 2;
    disabilityCbPanel.add(chckbxHeadInjury, gbc_chckbxHeadInjury);
    chckbxSeizures = new JCheckBox("Seizures");
    GridBagConstraints gbc_chckbxSeizures = new GridBagConstraints();
    gbc_chckbxSeizures.anchor = GridBagConstraints.WEST;
    gbc_chckbxSeizures.fill = GridBagConstraints.VERTICAL;
    gbc_chckbxSeizures.insets = new Insets(0, 0, 0, 5);
    gbc_chckbxSeizures.gridx = 0;
    gbc_chckbxSeizures.gridy = 3;
    disabilityCbPanel.add(chckbxSeizures, gbc_chckbxSeizures);
    chckbxOtherspecify = new JCheckBox("Other (specify)");
    chckbxOtherspecify.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(ItemEvent event) {
            if (event.getStateChange() == ItemEvent.SELECTED) {
              disabilityOtherTextField.setEnabled(true);
            } else if (event.getStateChange() == ItemEvent.DESELECTED) {
              disabilityOtherTextField.setEnabled(false);
              disabilityOtherTextField.setText("");
            }
          }
        });
    GridBagConstraints gbc_chckbxOtherspecify = new GridBagConstraints();
    gbc_chckbxOtherspecify.anchor = GridBagConstraints.WEST;
    gbc_chckbxOtherspecify.insets = new Insets(0, 0, 0, 5);
    gbc_chckbxOtherspecify.gridx = 2;
    gbc_chckbxOtherspecify.gridy = 3;
    disabilityCbPanel.add(chckbxOtherspecify, gbc_chckbxOtherspecify);

    disabilityOtherTextField = new JFormattedTextField();
    disabilityOtherTextField.setEnabled(false);
    filter.setupTextField(disabilityOtherTextField, DocumentSizeFilter.ANY, 30);
    GridBagConstraints gbc_disabilityOtherTextField = new GridBagConstraints();
    gbc_disabilityOtherTextField.gridwidth = 2;
    gbc_disabilityOtherTextField.fill = GridBagConstraints.BOTH;
    gbc_disabilityOtherTextField.gridx = 3;
    gbc_disabilityOtherTextField.gridy = 3;
    disabilityCbPanel.add(disabilityOtherTextField, gbc_disabilityOtherTextField);
    GridBagConstraints gbc_disabilityCbPanel = new GridBagConstraints();
    gbc_disabilityCbPanel.weightx = 1.0;
    gbc_disabilityCbPanel.fill = GridBagConstraints.VERTICAL;
    gbc_disabilityCbPanel.gridwidth = 3;
    gbc_disabilityCbPanel.gridx = 0;
    gbc_disabilityCbPanel.gridy = 1;
    DisabilityPanel.add(disabilityCbPanel, gbc_disabilityCbPanel);

    ethnicityPanel = new JPanel();
    ethnicityPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));
    GridBagConstraints gbc_ethnicityPanel = new GridBagConstraints();
    gbc_ethnicityPanel.weightx = 1.0;
    gbc_ethnicityPanel.weighty = 0.1;
    gbc_ethnicityPanel.fill = GridBagConstraints.BOTH;
    gbc_ethnicityPanel.insets = new Insets(0, 10, 5, 10);
    gbc_ethnicityPanel.gridx = 0;
    gbc_ethnicityPanel.gridy = 2;
    add(ethnicityPanel, gbc_ethnicityPanel);
    GridBagLayout gbl_ethnicityPanel = new GridBagLayout();
    gbl_ethnicityPanel.columnWidths = new int[] {126, 0, 46, 0};
    gbl_ethnicityPanel.rowHeights = new int[] {22, 95, 0};
    gbl_ethnicityPanel.columnWeights = new double[] {0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_ethnicityPanel.rowWeights = new double[] {0.0, 0.0, Double.MIN_VALUE};
    ethnicityPanel.setLayout(gbl_ethnicityPanel);

    ethnicityLabel = new JLabel("Client's Ethnicity");
    ethnicityLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
    GridBagConstraints gbc_ethnicityLabel = new GridBagConstraints();
    gbc_ethnicityLabel.anchor = GridBagConstraints.SOUTHWEST;
    gbc_ethnicityLabel.insets = topInsetBumper;
    gbc_ethnicityLabel.gridx = 0;
    gbc_ethnicityLabel.gridy = 0;
    ethnicityPanel.add(ethnicityLabel, gbc_ethnicityLabel);

    ethnicityNotSetWarning = new JTextPane();
    ethnicityNotSetWarning.setVisible(false);
    ethnicityNotSetWarning.setText("*");
    ethnicityNotSetWarning.setForeground(Color.RED);
    ethnicityNotSetWarning.setEditable(false);
    ethnicityNotSetWarning.setBackground(SystemColor.menu);
    GridBagConstraints gbc_ethnicityNotSetWarning = new GridBagConstraints();
    gbc_ethnicityNotSetWarning.anchor = GridBagConstraints.NORTHWEST;
    gbc_ethnicityNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_ethnicityNotSetWarning.gridx = 1;
    gbc_ethnicityNotSetWarning.gridy = 0;
    ethnicityPanel.add(ethnicityNotSetWarning, gbc_ethnicityNotSetWarning);

    ethnicityCbPanel = new JPanel();
    GridBagLayout gbl_ethnicityCbPanel = new GridBagLayout();
    gbl_ethnicityCbPanel.columnWidths = new int[] {100, 100, 100, 100, 100};
    gbl_ethnicityCbPanel.rowHeights = new int[] {20, 20, 20};
    gbl_ethnicityCbPanel.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0};
    gbl_ethnicityCbPanel.rowWeights = new double[] {0.0, 0.0, 0.0};
    ethnicityCbPanel.setLayout(gbl_ethnicityCbPanel);

    caucasianCheckBox = new JCheckBox("Caucasian");
    GridBagConstraints gbc_caucasianCheckBox = new GridBagConstraints();
    gbc_caucasianCheckBox.anchor = GridBagConstraints.NORTHWEST;
    gbc_caucasianCheckBox.insets = leftInsetBumper;
    gbc_caucasianCheckBox.gridx = 0;
    gbc_caucasianCheckBox.gridy = 0;
    ethnicityCbPanel.add(caucasianCheckBox, gbc_caucasianCheckBox);
    nativeAmericanCheckBox = new JCheckBox("Native American");
    GridBagConstraints gbc_nativeAmericanCheckBox = new GridBagConstraints();
    gbc_nativeAmericanCheckBox.anchor = GridBagConstraints.NORTHWEST;
    gbc_nativeAmericanCheckBox.insets = new Insets(0, 0, 5, 5);
    gbc_nativeAmericanCheckBox.gridx = 2;
    gbc_nativeAmericanCheckBox.gridy = 0;
    ethnicityCbPanel.add(nativeAmericanCheckBox, gbc_nativeAmericanCheckBox);
    africanAmericanCheckBox = new JCheckBox("African American");
    GridBagConstraints gbc_africanAmericanCheckBox = new GridBagConstraints();
    gbc_africanAmericanCheckBox.anchor = GridBagConstraints.NORTHWEST;
    gbc_africanAmericanCheckBox.insets = leftInsetBumper;
    gbc_africanAmericanCheckBox.gridx = 0;
    gbc_africanAmericanCheckBox.gridy = 1;
    ethnicityCbPanel.add(africanAmericanCheckBox, gbc_africanAmericanCheckBox);
    asianCheckBox = new JCheckBox("Asian");
    GridBagConstraints gbc_asianCheckBox = new GridBagConstraints();
    gbc_asianCheckBox.anchor = GridBagConstraints.NORTHWEST;
    gbc_asianCheckBox.insets = new Insets(0, 0, 5, 5);
    gbc_asianCheckBox.gridx = 2;
    gbc_asianCheckBox.gridy = 1;
    ethnicityCbPanel.add(asianCheckBox, gbc_asianCheckBox);
    hispanicCheckBox = new JCheckBox("Hispanic");
    GridBagConstraints gbc_hispanicCheckBox = new GridBagConstraints();
    gbc_hispanicCheckBox.anchor = GridBagConstraints.NORTHWEST;
    gbc_hispanicCheckBox.insets = leftInsetBumper;
    gbc_hispanicCheckBox.gridx = 0;
    gbc_hispanicCheckBox.gridy = 2;
    ethnicityCbPanel.add(hispanicCheckBox, gbc_hispanicCheckBox);
    otherEthnicityCheckBox = new JCheckBox("Other (specify)");
    GridBagConstraints gbc_otherEthnicityCheckBox = new GridBagConstraints();
    gbc_otherEthnicityCheckBox.anchor = GridBagConstraints.NORTHWEST;
    gbc_otherEthnicityCheckBox.insets = new Insets(0, 0, 0, 5);
    gbc_otherEthnicityCheckBox.gridx = 2;
    gbc_otherEthnicityCheckBox.gridy = 2;
    ethnicityCbPanel.add(otherEthnicityCheckBox, gbc_otherEthnicityCheckBox);
    otherEthnicityTextField = new JFormattedTextField();
    otherEthnicityTextField.setEnabled(false);
    GridBagConstraints gbc_otherEthnicityTextField = new GridBagConstraints();
    gbc_otherEthnicityTextField.gridwidth = 2;
    gbc_otherEthnicityTextField.fill = GridBagConstraints.HORIZONTAL;
    gbc_otherEthnicityTextField.gridx = 3;
    gbc_otherEthnicityTextField.gridy = 2;
    ethnicityCbPanel.add(otherEthnicityTextField, gbc_otherEthnicityTextField);
    GridBagConstraints gbc_ethnicityCbPanel = new GridBagConstraints();
    gbc_ethnicityCbPanel.gridwidth = 3;
    gbc_ethnicityCbPanel.insets = new Insets(0, 0, 0, 10);
    gbc_ethnicityCbPanel.weightx = 1.0;
    gbc_ethnicityCbPanel.fill = GridBagConstraints.VERTICAL;
    gbc_ethnicityCbPanel.gridx = 0;
    gbc_ethnicityCbPanel.gridy = 1;
    ethnicityPanel.add(ethnicityCbPanel, gbc_ethnicityCbPanel);

    ComNeedsPanel = new JPanel();
    ComNeedsPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));
    GridBagConstraints gbc_ComNeedsPanel = new GridBagConstraints();
    gbc_ComNeedsPanel.weightx = 1.0;
    gbc_ComNeedsPanel.weighty = 0.1;
    gbc_ComNeedsPanel.fill = GridBagConstraints.BOTH;
    gbc_ComNeedsPanel.gridx = 0;
    gbc_ComNeedsPanel.gridy = 3;
    gbc_ComNeedsPanel.insets = new Insets(0, 10, 10, 10);
    add(ComNeedsPanel, gbc_ComNeedsPanel);
    GridBagLayout gbl_ComNeedsPanel = new GridBagLayout();
    gbl_ComNeedsPanel.columnWidths = new int[] {170, 14, 422, 0};
    gbl_ComNeedsPanel.rowHeights = new int[] {29, 57, 0};
    gbl_ComNeedsPanel.columnWeights = new double[] {0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_ComNeedsPanel.rowWeights = new double[] {0.0, 0.0, Double.MIN_VALUE};
    ComNeedsPanel.setLayout(gbl_ComNeedsPanel);

    communicationNeedsLabel = new JLabel("Communication Needs:");
    communicationNeedsLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
    GridBagConstraints gbc_communicationNeedsLabel = new GridBagConstraints();
    gbc_communicationNeedsLabel.anchor = GridBagConstraints.SOUTHWEST;
    gbc_communicationNeedsLabel.insets = topInsetBumper;
    gbc_communicationNeedsLabel.gridy = 0;
    ComNeedsPanel.add(communicationNeedsLabel, gbc_communicationNeedsLabel);

    comNotSetWarning = new JTextPane();
    comNotSetWarning.setBackground(SystemColor.menu);
    comNotSetWarning.setEditable(false);
    comNotSetWarning.setForeground(Color.RED);
    comNotSetWarning.setText("*");
    comNotSetWarning.setVisible(false);
    GridBagConstraints gbc_comNotSetWarning = new GridBagConstraints();
    gbc_comNotSetWarning.anchor = GridBagConstraints.WEST;
    gbc_comNotSetWarning.fill = GridBagConstraints.VERTICAL;
    gbc_comNotSetWarning.insets = new Insets(0, 0, 5, 5);
    gbc_comNotSetWarning.gridx = 1;
    gbc_comNotSetWarning.gridy = 0;
    ComNeedsPanel.add(comNotSetWarning, gbc_comNotSetWarning);

    comNeedsCbPanel = new JPanel();
    GridBagLayout gbl_comNeedsCbPanel = new GridBagLayout();
    gbl_comNeedsCbPanel.columnWidths = new int[] {0, 0, 0, 0, 0};
    gbl_comNeedsCbPanel.rowHeights = new int[] {30};
    gbl_comNeedsCbPanel.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
    gbl_comNeedsCbPanel.rowWeights = new double[] {0.0};
    comNeedsCbPanel.setLayout(gbl_comNeedsCbPanel);

    ttyCheckBox = new JCheckBox("TTY");
    GridBagConstraints gbc_ttyCheckBox = new GridBagConstraints();
    gbc_ttyCheckBox.insets = new Insets(0, 0, 0, 5);
    gbc_ttyCheckBox.gridx = 0;
    gbc_ttyCheckBox.gridy = 0;
    comNeedsCbPanel.add(ttyCheckBox, gbc_ttyCheckBox);

    signInterCheckBox = new JCheckBox("Sign Interpreter");
    GridBagConstraints gbc_signInterCheckBox = new GridBagConstraints();
    gbc_signInterCheckBox.insets = new Insets(0, 0, 0, 5);
    gbc_signInterCheckBox.gridx = 1;
    gbc_signInterCheckBox.gridy = 0;
    comNeedsCbPanel.add(signInterCheckBox, gbc_signInterCheckBox);

    otherComNeedsCheckBox = new JCheckBox("Other (Specify):");
    GridBagConstraints gbc_otherComNeedsCheckBox = new GridBagConstraints();
    gbc_otherComNeedsCheckBox.insets = new Insets(0, 0, 0, 5);
    gbc_otherComNeedsCheckBox.gridx = 2;
    gbc_otherComNeedsCheckBox.gridy = 0;
    comNeedsCbPanel.add(otherComNeedsCheckBox, gbc_otherComNeedsCheckBox);

    otherComNeedsTextField = new JTextField();
    GridBagConstraints gbc_otherComNeedsTextField = new GridBagConstraints();
    gbc_otherComNeedsTextField.fill = GridBagConstraints.HORIZONTAL;
    gbc_otherComNeedsTextField.gridx = 3;
    gbc_otherComNeedsTextField.gridy = 0;
    comNeedsCbPanel.add(otherComNeedsTextField, gbc_otherComNeedsTextField);
    otherComNeedsTextField.setColumns(10);
    filter.setupTextField(otherComNeedsTextField, DocumentSizeFilter.AL_NO, 30);
    GridBagConstraints gbc_comNeedsCbPanel = new GridBagConstraints();
    gbc_comNeedsCbPanel.fill = GridBagConstraints.VERTICAL;
    gbc_comNeedsCbPanel.gridx = 2;
    gbc_comNeedsCbPanel.gridy = 1;
    ComNeedsPanel.add(comNeedsCbPanel, gbc_comNeedsCbPanel);

    filter.setupTextField(otherEthnicityTextField, DocumentSizeFilter.ANY, 30);
    for (int i = 0; i < ethnicityCbPanel.getComponents().length; i++) {
      if (ethnicityCbPanel.getComponent(i) instanceof JCheckBox) {
        JCheckBox myCb = new JCheckBox();
        myCb = (JCheckBox) ethnicityCbPanel.getComponent(i);
        myCb.addItemListener(
            new ItemListener() {

              @Override
              public void itemStateChanged(ItemEvent event) {
                if ((event.getStateChange() == ItemEvent.SELECTED)
                    || (event.getStateChange() == ItemEvent.DESELECTED)) {
                  toggleAllCheckBoxesInPanel(ethnicityCbPanel, event.getItem());
                  // Other ethnicity implies that the text field should be enabled.
                  if (event.getSource().equals(otherEthnicityCheckBox)) {
                    otherEthnicityTextField.setEnabled(otherEthnicityCheckBox.isSelected());
                    // Clear the text in this text field.
                    if (!otherEthnicityCheckBox.isSelected()) otherEthnicityTextField.setText("");
                  }
                }
              }
            });
      }
    }
  }
Example #20
0
  private void initialize() {
    setFont(new Font("Arial", Font.PLAIN, 14));
    setBackground(new Color(204, 51, 153));
    setSize(new Dimension(750, 500));
    setLayout(null);

    // main pic
    final JLabel lblMainPic = new JLabel("");
    lblMainPic.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    lblMainPic.setIcon(new ImageIcon(Packages.class.getResource("/images/wedding.jpg")));
    lblMainPic.setOpaque(true);
    lblMainPic.setHorizontalTextPosition(SwingConstants.CENTER);
    lblMainPic.setForeground(new Color(0, 0, 0));
    lblMainPic.setHorizontalAlignment(SwingConstants.CENTER);
    lblMainPic.setBackground(new Color(240, 255, 255));
    lblMainPic.setBounds(304, 53, 200, 200);
    add(lblMainPic);

    // wedding button
    JButton btnNewButton = new JButton("");

    btnNewButton.setIcon(new ImageIcon(Packages.class.getResource("/images/wedding resized.jpg")));
    btnNewButton.setMargin(new Insets(2, 0, 2, 0));
    btnNewButton.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    btnNewButton.setAlignmentX(Component.CENTER_ALIGNMENT);
    btnNewButton.setHorizontalTextPosition(SwingConstants.CENTER);
    btnNewButton.setBounds(304, 264, 50, 50);
    add(btnNewButton);
    btnNewButton.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent arg0) {
            lblMainPic.setIcon(new ImageIcon(Packages.class.getResource("/images/wedding.jpg")));
          }
        });

    // party button
    JButton button = new JButton("");

    button.setIcon(new ImageIcon(Packages.class.getResource("/images/party resized.jpg")));
    button.setMargin(new Insets(2, 0, 2, 0));
    button.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    button.setHorizontalTextPosition(SwingConstants.CENTER);
    button.setAlignmentX(0.5f);
    button.setBounds(376, 264, 50, 50);
    add(button);
    button.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            lblMainPic.setIcon(new ImageIcon(Packages.class.getResource("/images/party.jpg")));
          }
        });

    // company dinner button
    JButton button_1 = new JButton("");

    button_1.setIcon(
        new ImageIcon(Packages.class.getResource("/images/company dinner resized.jpg")));
    button_1.setMargin(new Insets(2, 0, 2, 0));
    button_1.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    button_1.setHorizontalTextPosition(SwingConstants.CENTER);
    button_1.setAlignmentX(0.5f);
    button_1.setBounds(454, 264, 50, 50);
    add(button_1);
    button_1.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            lblMainPic.setIcon(
                new ImageIcon(Packages.class.getResource("/images/company dinner.jpg")));
          }
        });

    JLabel lblPackages = new JLabel("Packages");
    lblPackages.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    lblPackages.setForeground(new Color(255, 255, 255));
    lblPackages.setBackground(new Color(153, 51, 153));
    lblPackages.setFont(new Font("Arial", Font.BOLD, 15));
    lblPackages.setHorizontalTextPosition(SwingConstants.CENTER);
    lblPackages.setHorizontalAlignment(SwingConstants.CENTER);
    lblPackages.setAlignmentX(Component.CENTER_ALIGNMENT);
    lblPackages.setOpaque(true);
    lblPackages.setBounds(89, 327, 100, 40);
    add(lblPackages);

    JLabel lblMeetingRm = new JLabel("\u2022\tWeddings");
    lblMeetingRm.setHorizontalAlignment(SwingConstants.LEFT);
    lblMeetingRm.setFont(new Font("Arial", Font.PLAIN, 14));
    lblMeetingRm.setForeground(new Color(0, 0, 0));
    lblMeetingRm.setHorizontalTextPosition(SwingConstants.CENTER);
    lblMeetingRm.setBounds(89, 378, 100, 24);
    add(lblMeetingRm);

    JLabel lblActivityRm = new JLabel("\u2022\tParty");
    lblActivityRm.setHorizontalTextPosition(SwingConstants.CENTER);
    lblActivityRm.setHorizontalAlignment(SwingConstants.LEFT);
    lblActivityRm.setForeground(new Color(0, 0, 0));
    lblActivityRm.setFont(new Font("Arial", Font.PLAIN, 14));
    lblActivityRm.setBounds(89, 413, 100, 24);
    add(lblActivityRm);

    JLabel lblHall = new JLabel("\u2022\tCompany Dinner");
    lblHall.setHorizontalTextPosition(SwingConstants.CENTER);
    lblHall.setHorizontalAlignment(SwingConstants.LEFT);
    lblHall.setForeground(new Color(0, 0, 0));
    lblHall.setFont(new Font("Arial", Font.PLAIN, 14));
    lblHall.setBounds(89, 448, 119, 24);
    add(lblHall);

    JLabel lblPrices = new JLabel("Prices");
    lblPrices.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    lblPrices.setHorizontalTextPosition(SwingConstants.CENTER);
    lblPrices.setHorizontalAlignment(SwingConstants.CENTER);
    lblPrices.setForeground(new Color(255, 255, 255));
    lblPrices.setFont(new Font("Arial", Font.BOLD, 15));
    lblPrices.setOpaque(true);
    lblPrices.setBackground(new Color(153, 51, 153));
    lblPrices.setBounds(234, 327, 100, 40);
    add(lblPrices);

    JLabel lblMeetingPrice = new JLabel("$40,000");
    lblMeetingPrice.setForeground(new Color(0, 0, 0));
    lblMeetingPrice.setFont(new Font("Arial", Font.PLAIN, 14));
    lblMeetingPrice.setBounds(244, 378, 90, 24);
    add(lblMeetingPrice);

    JLabel lblActivityPrice = new JLabel("$6,000");
    lblActivityPrice.setFont(new Font("Arial", Font.PLAIN, 14));
    lblActivityPrice.setForeground(new Color(0, 0, 0));
    lblActivityPrice.setBounds(244, 416, 90, 19);
    add(lblActivityPrice);

    JLabel lblHallPrice = new JLabel("$15,000");
    lblHallPrice.setFont(new Font("Arial", Font.PLAIN, 14));
    lblHallPrice.setForeground(new Color(0, 0, 0));
    lblHallPrice.setBounds(244, 451, 90, 19);
    add(lblHallPrice);

    JLabel lblDesc = new JLabel("Description");
    lblDesc.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    lblDesc.setBackground(new Color(153, 51, 153));
    lblDesc.setOpaque(true);
    lblDesc.setHorizontalTextPosition(SwingConstants.CENTER);
    lblDesc.setHorizontalAlignment(SwingConstants.CENTER);
    lblDesc.setForeground(new Color(255, 255, 255));
    lblDesc.setFont(new Font("Arial", Font.BOLD, 15));
    lblDesc.setBounds(416, 325, 306, 40);
    add(lblDesc);

    JTextPane txtpnDescTxt = new JTextPane();
    txtpnDescTxt.setFont(new Font("Arial", Font.PLAIN, 14));
    txtpnDescTxt.setForeground(new Color(0, 0, 0));
    txtpnDescTxt.setOpaque(false);
    txtpnDescTxt.setText(
        "Our packages includes services from our experienced staff and the venue where is occasion is taking place. Please approach the receptionist to book a package or for further enquires.");
    txtpnDescTxt.setBounds(416, 377, 306, 112);
    add(txtpnDescTxt);

    JLabel lblPackages_1 = new JLabel("Packages");
    lblPackages_1.setFont(new Font("Tahoma", Font.PLAIN, 30));
    lblPackages_1.setBounds(484, 0, 157, 43);
    add(lblPackages_1);
  }
Example #21
0
  /**
   * Returns a JPanel that represents the mancala board using strategy pattern to insert style.
   *
   * @param strat concrete strategy
   * @return JPanel containing both users' pits as controllers
   */
  public JPanel boardContextDoWork(Strategy strat) {
    this.s = strat;
    Color boardColor = s.getBoardColor();
    Color fontColor = s.getFontColor();
    Font font = s.getFont();
    JPanel panCenter = new JPanel();
    JPanel panLeft = new JPanel();
    JPanel panRight = new JPanel();

    panCenter.setLayout(new GridLayout(2, 6, 10, 10));
    // B6 to B1 Controllers
    for (int i = 12; i > 6; i--) {
      final Pits temp = new Pits(i);
      final int pit = i;
      final JLabel tempLabel = new JLabel(temp);
      tempLabel.addMouseListener(
          new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
              if (Model.player == 1) {
                JFrame frame = new JFrame();
                JOptionPane.showMessageDialog(frame, "Player A's turn!");
              } else if (model.data[pit] == 0) {
                JFrame frame = new JFrame();
                JOptionPane.showMessageDialog(frame, "Pit is Empty try another one.");
              } else {
                if (temp.pitShape.contains(e.getPoint())) {
                  model.move(pit); // mutator
                  undoBtn.setText("Undo : " + model.getUndoCounter());
                  model.display();
                }
              }
            }
          });
      JPanel tempPanel = new JPanel(new BorderLayout());

      JTextPane textPane = new JTextPane();
      textPane.setEditable(false);
      textPane.setBackground(boardColor);
      textPane.setForeground(fontColor);
      textPane.setFont(font);
      textPane.setText("B" + (i - 6));
      StyledDocument doc = textPane.getStyledDocument();
      SimpleAttributeSet center = new SimpleAttributeSet();
      StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
      doc.setParagraphAttributes(0, doc.getLength(), center, false);
      tempPanel.add(textPane, BorderLayout.NORTH);
      tempPanel.add(tempLabel, BorderLayout.SOUTH);
      panCenter.add(tempPanel, BorderLayout.SOUTH);

      tempPanel.setBackground(boardColor);
    }
    // A1 to A6 Controllers
    for (int i = 0; i < 6; i++) {
      final Pits newPits = new Pits(i);
      JLabel label = new JLabel(newPits);
      final int pit = i;
      label.addMouseListener(
          new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
              if (Model.player == 2) {
                JFrame frame = new JFrame();
                JOptionPane.showMessageDialog(frame, "Player B's turn!");
              } else if (model.data[pit] == 0) {
                JFrame frame = new JFrame();
                JOptionPane.showMessageDialog(frame, "Pit is Empty try another one.");
              } else {
                if (newPits.pitShape.contains(e.getPoint())) {
                  model.move(pit); // mutator
                  undoBtn.setText("Undo : " + model.getUndoCounter());
                  model.display();
                }
              }
            }
          });
      JPanel tempPanel = new JPanel(new BorderLayout());

      tempPanel.add(label, BorderLayout.NORTH);
      JTextPane textPane = new JTextPane();
      textPane.setBackground(boardColor);
      textPane.setForeground(fontColor);
      textPane.setFont(font);
      textPane.setEditable(false);
      textPane.setText("A" + (i + 1));
      StyledDocument doc = textPane.getStyledDocument();
      SimpleAttributeSet center = new SimpleAttributeSet();
      StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
      doc.setParagraphAttributes(0, doc.getLength(), center, false);
      tempPanel.add(textPane, BorderLayout.SOUTH);
      tempPanel.setBackground(boardColor);
      panCenter.add(tempPanel, BorderLayout.SOUTH);
    }

    // left text pane
    JTextPane paneLeft = new JTextPane();
    paneLeft.setBackground(boardColor);
    paneLeft.setForeground(fontColor);
    paneLeft.setFont(font);
    paneLeft.setEditable(false);
    paneLeft.setText("M\nA\nN\nC\nA\nL\nA\n \nB");

    // right text pane
    JTextPane paneRight = new JTextPane();
    paneRight.setBackground(boardColor);
    paneRight.setForeground(fontColor);
    paneRight.setFont(font);
    paneRight.setEditable(false);
    paneRight.setText("M\nA\nN\nC\nA\nL\nA\n \nA");

    // Add text panes to left and right panels
    panLeft.setLayout(new BorderLayout());
    panRight.setLayout(new BorderLayout());
    panLeft.add(paneLeft, BorderLayout.WEST);
    panRight.add(paneRight, BorderLayout.EAST);
    panLeft.add(new JLabel(new Pits(13)), BorderLayout.EAST);
    panRight.add(new JLabel(new Pits(6)), BorderLayout.WEST);

    // add the 2 mancala panels and pit panel to larger displayPanel
    JPanel displayPanel = new JPanel();
    displayPanel.add(panLeft, BorderLayout.WEST);
    displayPanel.add(panCenter, BorderLayout.CENTER);
    displayPanel.add(panRight, BorderLayout.EAST);

    // set color
    panCenter.setBackground(boardColor);
    panLeft.setBackground(boardColor);
    panRight.setBackground(boardColor);
    displayPanel.setBackground(boardColor);

    // return display panel which contains the containers and elements created
    return displayPanel;
  }
Example #22
0
  public static void ConfigureMainWindow() {
    userNameLabel.setFont(new Font("Lucida Console", 0, 14));
    userNameLabel.setForeground(new Color(255, 255, 255));

    mainWindow.getContentPane().setBackground(new Color(4, 3, 10));
    mainWindow.setSize(800, 600);
    mainWindow.getContentPane().setLayout(null);
    connectButton.setBackground(new Color(255, 255, 255));
    connectButton.setForeground(new Color(4, 3, 10));
    connectButton.setFont(new Font("Lucida Console", 0, 14));

    connectButton.setText("Anslut");
    connectButton.setToolTipText("");
    mainWindow.getContentPane().add(connectButton);
    connectButton.setBounds(455, 10, 100, 25);

    conversation.setColumns(20);
    conversation.setFont(new Font("Lucida Console", 0, 14));
    conversation.setForeground(new Color(4, 3, 10));
    conversation.setLineWrap(true);
    conversation.setRows(5);
    // conversation.setEditable(false);

    tpConversation.setForeground(new Color(255, 255, 255));
    tpConversation.setBounds(10, 10, 600, 500);
    tpConversation.setBackground(new Color(4, 3, 10));
    tpConversation.setFont(new Font("Lucida Console", 0, 14));

    spConversation.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    spConversation.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    spConversation.setViewportView(tpConversation);
    mainWindow.getContentPane().add(spConversation);
    spConversation.setBounds(10, 10, 600, 500);

    userNameBox.setBounds(120, 10, 325, 25);
    userNameLabel.setBounds(10, 10, 130, 25);
    mainWindow.getContentPane().add(userNameBox);
    mainWindow.getContentPane().add(userNameLabel);

    usersOnline.setForeground(new Color(0, 180, 255));
    usersOnline.setBackground(new Color(4, 3, 10));
    usersOnline.setFont(new Font("Lucida Console", 0, 14));
    spUsersOnline.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    spUsersOnline.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    spUsersOnline.setViewportView(usersOnline);
    mainWindow.getContentPane().add(spUsersOnline);
    spUsersOnline.setBounds(620, 10, 165, 300);

    messageField.setForeground(new Color(255, 255, 255));
    messageField.setBackground(new Color(4, 3, 10));
    messageField.requestFocus();
    messageField.addActionListener(action);
    mainWindow.getContentPane().add(messageField);
    messageField.setBounds(10, 520, 600, 30);

    send.setBackground(new Color(255, 255, 255));
    send.setForeground(new Color(4, 3, 10));
    send.setText("Skicka");
    send.setFont(new Font("Lucida Console", 0, 14));
    mainWindow.getContentPane().add(send);
    send.setBounds(620, 520, 165, 30);

    disconnect.setBackground(new Color(255, 255, 255));
    disconnect.setForeground(new Color(4, 3, 10));
    disconnect.setText("Avsluta chatten");
    disconnect.setFont(new Font("Lucida Console", 0, 14));
    mainWindow.getContentPane().add(disconnect);
    disconnect.setBounds(620, 320, 165, 30);

    error.setFont(new Font("Lucida Console", 0, 14));
    error.setForeground(new Color(255, 0, 23));
    error.setBounds(120, 40, 525, 25);

    mainWindow.getContentPane().add(error);
  }
Example #23
0
  public void initComponents() {
    JFrame newFrame = new JFrame("Botthecatman");
    JButton sendMessage;

    newFrame.setResizable(true);
    newFrame.setVisible(true);
    newFrame.setBackground(Color.DARK_GRAY);
    JPanel southPanel = new JPanel();
    newFrame.add(BorderLayout.SOUTH, southPanel);
    southPanel.setBackground(Color.DARK_GRAY);
    southPanel.setLayout(new GridBagLayout());

    messageBox = new JTextField(30);
    sendMessage = new JButton("Send Message");
    chatBox = new JTextPane();
    chatBox.setFont(new Font("Verdana", Font.PLAIN, 14));
    chatBox.setEditable(false);
    chatBox.setBackground(Color.DARK_GRAY);
    chatBox.setForeground(Color.WHITE);
    JScrollPane scroller = new JScrollPane(chatBox);
    newFrame.add(scroller, BorderLayout.CENTER);

    scroller
        .getVerticalScrollBar()
        .addAdjustmentListener(
            new AdjustmentListener() {
              public void adjustmentValueChanged(AdjustmentEvent e) {
                e.getAdjustable().setValue(e.getAdjustable().getMaximum());
              }
            });

    // chatBox.setLineWrap(true);

    GridBagConstraints left = new GridBagConstraints();
    left.anchor = GridBagConstraints.WEST;
    GridBagConstraints right = new GridBagConstraints();
    right.anchor = GridBagConstraints.EAST;
    right.weightx = 2.0;

    southPanel.add(messageBox, left.fill);
    southPanel.add(sendMessage, right);

    chatBox.setFont(new Font("Serif", Font.PLAIN, 15));
    sendMessage.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {

            if (GUI.messageBox.getText().length() < 1) {
              // do nothing
            } else if (GUI.messageBox.getText().equals(".clear")) {
              GUI.chatBox.setText("Cleared all messages\n");
              GUI.messageBox.setText("");
            } else {
              BotClass.bot.messageExecute(joinChannel, GUI.messageBox.getText());
              GUI.messageBox.setText("");
              // getCmd.regCommand(getCmd.splitMessage(GUI.messageBox.getText()), GUI.joinChannel,
              // "BOTthecatman");
            }
          }
        });
    newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    newFrame.setSize(470, 300);

    newFrame.addWindowListener(
        new WindowAdapter() {

          public void windowClosing(WindowEvent e) {
            Log chatLog = new Log();
            chatLog.writeLog();
            System.out.println("Bot Closed");
            e.getWindow().dispose();
          }
        });
  }
Example #24
0
 public void displayError(String s) {
   errorPane.setVisible(true);
   errorPane.setText(s);
   errorPane.setBackground(Color.RED);
   errorPane.setForeground(Color.WHITE);
 }
Example #25
0
 public void compilingSuccessful() {
   errorPane.setVisible(true);
   errorPane.setText("Compiling Successful!");
   errorPane.setBackground(Color.GREEN);
   errorPane.setForeground(Color.BLACK);
 }