Results 1 to 2 of 2
- 04-14-2011, 07:54 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 3
- Rep Power
- 0
- 04-14-2011, 03:46 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
There are a few ways!
You could paint the orange part in a jpanel
or put/add the jpanel to the right position and change the background color of the panelJava Code:public static void main(String[] args) throws Exception { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame(); JPanel panel = new JPanel(){ { setSize(400, 300); setPreferredSize(getSize()); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(new Color(255 ,128, 65)); g.fillRect(50, 50, 300, 200); } }; frame.add(panel); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); } }); }
...Java Code:setBackground(new Color(255 ,128, 65))
It depends on what kind of application that is and what do you want to show on it
Similar Threads
-
Change border color from blue to green of JFrame
By altu57 in forum AWT / SwingReplies: 1Last Post: 07-10-2010, 04:19 AM -
Change JFrame taskbar color?
By dunafrothint in forum AWT / SwingReplies: 3Last Post: 03-05-2010, 05:14 AM -
[COLOR="Navy"]execute .bat file in mysql [/COLOR]
By msankar.ravi in forum NetworkingReplies: 0Last Post: 02-24-2010, 04:27 AM -
JFrame window doesnt change background color
By Addez in forum New To JavaReplies: 7Last Post: 11-07-2009, 09:38 PM -
setting background color of JFrame form with NetBeans 6.1
By onefootswill in forum New To JavaReplies: 4Last Post: 08-12-2008, 07:02 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks