Important alert: (current site time 7/15/2013 3:00:26 PM EDT)
 

winzip icon

[ - Background/Foreground Color Changer - ]

Email
Submitted on: 10/30/2002 2:51:53 AM
By: Harshal Joshi  
Level: Intermediate
User Rating: By 19 Users
Compatibility: Java (JDK 1.2)
Views: 25972
author picture
(About the author)
 
     This code helpful in How to use Layouts, Scroll Bar, Label, Panel etc. Any feedback, comments would be greatly appreciated. Please vote for me if you download the code for use.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

12/18/2002 12:14:09 PM

no
(If this comment was disrespectful, please report it.)

 
3/27/2003 3:29:45 PMA1Programmer

Well... It does what you say it does. The window close event isn't handled though... you have to Control-C to close it... :/
(If this comment was disrespectful, please report it.)

 
2/20/2005 9:20:58 PM

Nice job Harshal!! Me likey :)

A1Programmer, just add something like this to the top:
f.addWindowListener( new WindowAdapter( )
{
public void windowClosing( WindowEvent e )
{
System.exit( 0 );
}
});
(If this comment was disrespectful, please report it.)

 
11/7/2006 11:34:28 AM

this message has apear if you execute that program:
Exception in thread "main" java.lang.OutOfMemoryError: null pData
at sun.awt.windows.WFramePeer.createAwtFrame(Native Method)
at sun.awt.windows.WFramePeer.create(WFramePeer.java:158)
at sun.awt.windows.WComponentPeer.(WComponentPeer.java:509)
at sun.awt.windows.WCanvasPeer.(WCanvasPeer.java:35)
at sun.awt.windows.WPanelPeer.(WPanelPeer.java:53)
at sun.awt.windows.WWindowPeer.(WWindowPeer.java:74)
at sun.awt.windows.WFramePeer.(WFramePeer.java:146)
at sun.awt.windows.WToolkit.createFrame(WToolkit.java:353)
at java.awt.Frame.addNotify(Frame.java:472)
at java.awt.Window.show(Window.java:459)
at java.awt.Component.show(Component.java:1133)
at java.awt.Component.setVisible(Component.java:1088)
at ColorChange.main(ColorChange.java:10)






(If this comment was disrespectful, please report it.)

 
12/3/2006 3:43:27 AMashok

its nice i read its details
(If this comment was disrespectful, please report it.)

 
12/8/2006 1:32:53 AMKaleel

Yah Good.....
(If this comment was disrespectful, please report it.)

 
2/19/2007 2:57:53 AMnishanthasn

Yah Good.....

(If this comment was disrespectful, please report it.)

 
8/22/2007 6:38:20 AMkevin titus

the was "wow'
(If this comment was disrespectful, please report it.)

 
11/21/2007 1:21:23 PMparag

its coooooooooool
(If this comment was disrespectful, please report it.)

 
9/27/2008 6:48:55 PM

Well this is a nice example, but unfortunately there are not code comments explaining what the code is doing. Yes this is in the intermediate coding area, but that is no excuse. Another thing that bothers me about this example is the coding style. Why would anyone want to call a class "C" or name a label object l3? All the label names look like numbers 13, 14 and 15. This is just a lazy coding style in my opinion. Please try to remember that some people look at source code to learn from (including myself), so try to use code comments and a better variable naming convention.
(If this comment was disrespectful, please report it.)

 
4/6/2009 5:41:37 AMsubba rao

very nice
(If this comment was disrespectful, please report it.)

 
2/4/2013 9:23:11 PMHarleymar

very good.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.