JButton okButton = new JButton("OK");
okButton.setBackground(Color.red);
void setBackground(Color c) - this method sets the background color for the component.
void setForeground(Color c) - this method sets the foreground color for the component.
void setFont(Font f) - this method sets the current font for the component. For components that have labels, for instance JLabel and JButton, this font is used to display the text for the label. For text components (such as JTextField and JTextArea objects) the font is used to display the text inside the component.
void setPreferredSize(Dimension d) - this method sets the preferred size for the component, which will be used as the default size, if possible.
void setMinimumSize(Dimension d) - As components are added, they are automatically resized. This method sets the minimum size for the component.
void setMaximumSize(Dimension d) - As components are added, they are automatically resized. This method sets the maximum size for the component.
void setToolTipText(String s) - this method sets the tool tip text for the component to the passed-in String. A tool tip is a short string that appears on the screen based on where the mouse pointer is located. A component that has a tool tip text will show this string when the user moves the mouse over the component.