Results 1 to 3 of 3

Thread: How can I do this in JAVA

  1. #1
    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.

  2. #2
    Join Date
    Aug 2004
    Location
    TA HeadQuarter
    Posts
    80

    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.

  3. #3
    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());

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Setting Of Java to The Point At Manual Java
    By winni in forum Software Development
    Replies: 4
    Last Post: 10-01-2011, 10:05 PM
  3. Java Programming using Adventnet SNMP Java API
    By ROCKING_Suhas in forum Software Development
    Replies: 5
    Last Post: 17-07-2010, 06:52 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,193,017.62309 seconds with 16 queries