Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 132,144 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,030 people online right now. Registration is fast and FREE... Join Now!




texbox GUI

 
Reply to this topicStart new topic

texbox GUI, text box color

chengggg
post 9 Oct, 2008 - 05:29 AM
Post #1


New D.I.C Head

*
Joined: 1 Oct, 2008
Posts: 14

I want to ask......about making the textbox in the program in GUI....

in the JFrame textbox....and also the background color

to have a color.....

do you get what I mean?....

plzzz reply it really help me if you contribute.......thank youaaaa

I'm a newbie in java.......plzz help me

This post has been edited by chengggg: 9 Oct, 2008 - 05:33 AM
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 9 Oct, 2008 - 06:03 AM
Post #2


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


You basically just mean changing the entire background colour of a JTextArea?

Check this out:
java
import javax.swing.JTextArea;
import javax.swing.JFrame;
import java.awt.Color;

public class DIC extends JFrame {
JTextArea text = new JTextArea();
public DIC() {
this.getContentPane().add(text); // add the JTextArea to our JFrame
this.text.setBackground(Color.BLACK); // it's as simple as this one line
this.text.setForeground(Color.WHITE); // set the text colour so it's visible
this.setSize(500,500); // adjust the size of our JFrame
this.setVisible(true); // display our JFrame
}

public static void main(String arg[]) {
DIC application = new DIC();

}
}

Hope this helps smile.gif
User is offlineProfile CardPM

Go to the top of the page

chengggg
post 10 Oct, 2008 - 06:40 AM
Post #3


New D.I.C Head

*
Joined: 1 Oct, 2008
Posts: 14

thnx... for the code i;ll try this one....

it really helps me..........

thnx gabehabe
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 10 Oct, 2008 - 07:11 AM
Post #4


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


No problem~

You know, there is a thanks feature... wink.gif
User is offlineProfile CardPM

Go to the top of the page

chengggg
post 10 Oct, 2008 - 10:22 PM
Post #5


New D.I.C Head

*
Joined: 1 Oct, 2008
Posts: 14

ow i see now I know......
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 12:55PM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month