Results 1 to 2 of 2
Thread: Change color with hex code?
- 09-03-2012, 07:39 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 1
- Rep Power
- 0
Change color with hex code?
I am trying to write a code to change the color with a hex code. Actually I want to add my own colors instead of "black" "red" and so on. So if I write skyblue it should use "#3398F0".
I am working on the example project of BlueJ. If you use this program you should have it too.
Take a look at the picture. How can I add some different colors?
Thanks!
- 09-03-2012, 09:31 PM #2
Re: Change color with hex code?
Take a look at the constructors of java.awt.Color that take int parameters. Also Integer methods that take a String and an int radix.
Alternatively, you can hard-code a Map<String, Color> to do the lookup.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
Similar Threads
-
How to change background color
By Jeffrey4u in forum Sun Java Wireless ToolkitReplies: 0Last Post: 10-22-2011, 08:32 AM -
PLEASE HELP! how do i change the color of a pattern?
By armedrabbit in forum New To JavaReplies: 9Last Post: 04-20-2011, 08:51 PM -
Can't change the color of a button...
By mrbeast87 in forum AWT / SwingReplies: 5Last Post: 11-16-2010, 09:22 PM -
Change color of a region
By sky in forum AWT / SwingReplies: 5Last Post: 11-24-2009, 03:47 PM -
my code doesn't change background color
By javanoobita in forum New To JavaReplies: 5Last Post: 02-22-2009, 04:30 AM
Bookmarks