Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 12-05-2009
Member
 
Join Date: Feb 2009
Posts: 96
How can I do this in JAVA

what i need is the following:
Create an applet that has a JTextField for the user to enter the name of a color. If the color entered is not either red, white, blue, then your applet should throw an Exception and tell the user the color entered was not valid. Otherwise change the background color to the appropriate color.
Reply With Quote
  #2  
Old 12-05-2009
Administrator
 
Join Date: Aug 2004
Location: TA HeadQuarter
Posts: 82
Re: How can I do this in JAVA

Hello Daren,
Looks like you have a problem with your java related issues everyday or most often, I will suggest you using following site http://forums.sun.com/ to get immediate help.

Someone will surely help you fix your problem here.
__________________
News
Reply With Quote
  #3  
Old 12-05-2009
Member
 
Join Date: Apr 2008
Posts: 193
Re: How can I do this in JAVA

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());
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How can I do this in JAVA"
Thread Thread Starter Forum Replies Last Post
Java Auto Updater wants me to update java everyday in Windows 7 minajoh Windows Software 4 04-09-2013 11:04 PM
Setting Of Java to The Point At Manual Java winni Software Development 4 10-01-2011 10:05 PM
Java Programming using Adventnet SNMP Java API ROCKING_Suhas Software Development 5 17-07-2010 06:52 AM
Link List Example in Java Sample program in Java trickson Software Development 2 04-08-2009 08:23 PM


All times are GMT +5.5. The time now is 08:54 PM.