[5985] in java-interest

home help back first fref pref prev next nref lref last post

Re: colored text

daemon@ATHENA.MIT.EDU (Heather Swayne)
Thu Mar 7 15:24:49 1996

Date: Thu, 7 Mar 1996 06:52:05 PST
From: Heather Swayne <hswayne@wrc.xerox.com>
To: Mike Paluka <mikep@exmachina.com>
Cc: java-interest <java-interest@java.Eng.Sun.COM>

thank's for your input Mike but unforcunatly it didn't work.

Here is the piece of code that I'm working on maybe someone can see why setForeground.

 
class GUI extends Frame{
	
	Label resultField, newResult;
	GUI(){
						   						  
/* set up Window!!!!! */
		setTitle("test");
		setLayout(new BorderLayout());
		setFont(new Font("Helvetica", Font.PLAIN, 24));
		add("North", new Label("I hope this works", Label.CENTER));	 
		
		Panel south = new Panel();
		south.setLayout(new BorderLayout());  
		south.add("West", new Label("Result:"));
			Panel result = new Panel();
			result.setLayout(new BorderLayout());
 
// here's the problem: useing setBackground works fine?????
			result.setForeground(Color.blue);	 // sets color for this panel only
	 
			result.setFont(new Font("Helvetica", Font.PLAIN, 12));
				newResult = new Label("Please press run to display the answer"); 
				resultField = newResult;   		
			result.add("Center", resultField);			  
		south.add("Center", result);
		Panel east = new Panel();
		east.setFont(new Font("Helvetica", Font.PLAIN, 14));
			east.add("West", new Button("Run"));
			east.add("East", new Button("Close"));
		south.add("East",east);
		add("South",south);
		
		Panel center = new Panel();
		center.setLayout(new GridLayout(1,2)); 
		center.add(new FirstPanel(this));			 // add all fields
		center.add(new SecondPanel(this));
		add("Center",center);

		pack();
		show();

	}	// end GUI()
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post