/** Creates the error area component. */ private void initErrorArea() { SimpleAttributeSet attribs = new SimpleAttributeSet(); StyleConstants.setAlignment(attribs, StyleConstants.ALIGN_RIGHT); StyleConstants.setFontFamily(attribs, errorPane.getFont().getFamily()); StyleConstants.setForeground(attribs, Color.RED); errorPane.setParagraphAttributes(attribs, true); errorPane.setPreferredSize(new Dimension(100, 50)); errorPane.setMinimumSize(new Dimension(100, 50)); errorPane.setOpaque(false); }
/** * Shows the given error message. * * @param text the text of the error */ private void showErrorMessage(String text) { errorPane.setText(text); if (errorPane.getParent() == null) add(errorPane, BorderLayout.NORTH); SwingUtilities.getWindowAncestor(CreateSip2SipAccountForm.this).pack(); }
/** Clears all the data previously entered in the form. */ public void clear() { usernameField.setText(""); displayNameField.setText(""); passField.setText(""); retypePassField.setText(""); emailField.setText(""); errorPane.setText(""); remove(errorPane); }