You may use the following jtextfield programming logic to apply in your project.
Code:
JTextArea textArea = new JTextArea();
textArea.setOpaque(true);
textArea.setBackground(Color.Blue);
textArea.setForeground(Color.BLACK);
textArea.setText(answer);
textArea.setBorder(CommonUI.createEtchedBorder());
textArea.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
or else you may also have the following programming logic in your project.
Code:
someField.setBackground(new JTextField().getBackground());
Bookmarks