Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

may tan

Greenhorn
+ Follow
since Jul 22, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by may tan

oh ok.. but wad is the coding if i want to increase the size of e texts in the label??

and how i know what are e varoius size available in java??
like for example in html.. e size range frm 1 - 7.
so wad abt java??
14 years ago
HellOoo..

Is there a way to increase the text size on a label?
14 years ago
hmm.. is there really no other coding such that when user type in something in the textfield, all the texts will appear in the center instead of by default(left side)?
14 years ago
Erm.. actually i'm only suppose to use text field for user inputs..

Basically e problems is whenever the user enter number, other texts or colors not stated, it will give an error message in g.drawString.

"sorry, please enter a valid color."

i just need a simple coding for showing of error message whenever users key in numbers, other texts or colors not stated..

Can anyone show me what is the coding to it??


oh btw, i have already added.. actionListener for button, i wont be able to add windowListener right?
[ August 15, 2005: Message edited by: may tan ]
14 years ago
Hello pple..
thanks a lot for your responsese..


i'm still kind of lost because i never use errors detecting before..
so i dont have any coding that i can post here for u all to check..
hmm.. can i rephase my qns again??
then u all try help me out from there..


ok, i have 3 textfield that only ALLOWED the following colors.
[black, brown, red, orange, yellow, green, blue, violet, grey, white]

--------------------------------------------------------------------------
but if users enter "pink" or some other funny text like "haha" in any of the textfields, i want an error msg appearing below my applet as g.drawString stating:
"sorry, please enter a valid color."


and also,
if user enter any number in any of the textfield, it also gives an error msg as g.drawString stating:
"sorry, please enter a valid color."
--------------------------------------------------------------------------

Please help me with the coding.. i'm really stuck here..
Thanks =)
[ August 13, 2005: Message edited by: may tan ]
14 years ago
Hello.. thanks for your response..

i have this code in my program:

band1 = new Label("Color of Band 1", Label.CENTER);
text1 = new TextField(3);
text1.setBackground(Color.black);
text1.setHorizontalAlignment(TextField.CENTER);

pls look at my last sentence: "text1.setHorizontalAlignment(TextField.CENTER);"

why it doesn't seem to work? as in e texts are still not aligned to the cneter..
[ August 13, 2005: Message edited by: may tan ]
14 years ago
Hello..

thanks for ya responses.. erm somehow i dont really understand the coding u gave me as refernce..

how can these coding catch numbers error??

btw i got some errors when i compiled e coding u typed.
tt why i cant see the outcome of it..
14 years ago
hello..

can anyone tells me how to align my texts in text box to the center??

eg: i got 1 text field, when user input texts, it will appear in the center.. rather by defaults (at e left side)..
14 years ago
Hello =)

thanks for ya coding, i'm able to get what i want.
was trying out e coding e whole, it wasn't successful until your code came in..

but i did modify a bit..
i put e code as: this.setBackground(Color.GRAY);

anyway thanks for ya helps!!
cheerios..
14 years ago
hi..

i have 3 textfields..
these 3 textfields only allow text to be typed in..

if user type in numbers, it will give an error msg, informing user only text are allowed..

what is the simplest way to create an error msg under "g.drawString" to inform users?


for eg: g.drawString ("Error messgage: Please enter texts only.");
14 years ago
Hello..

i wanna fill color for my applet background..
eg: gray color..

how do i do that?
14 years ago
Hi pple..

Can someone tell me how & where (which public void) to put in color coding for Panel & Button??

Thanks!!
14 years ago
Sorry.. havent type finish my previuos qns..

okay i have the coding in my public void paint() method

{
AudioClip audioClip = getAudioClip(getCodeBase(), "17 Track 17.WAV");
audioClip.loop();
}

And also the follwoing html file in my "class" folder

<HTML>
<TITLE> Sound Demo APPLET </TITLE>
<APPLET CODE = "ComputeResistance.class" WIDTH=900 HEIGHT=1000></APPLET>
</HTML>

but why it doesnt seems to play any music?


Btw is it possible to add "4.17MB" song into my java?
will it hangs?

And what is the extension if it frm "window media player"??
is it .WAV?


Thanks =)
14 years ago
Hello.. i have this coding in my applet..

{

AudioClip audioClip = getAudioClip(getCodeBase(), "17 Track 17.WAV");
audioClip.loop();

}
14 years ago