hi, our final exam will be on next week, i want our program to be different may i ask how to put colors on texts of JOptionPane on the background and how to change font size and style and how to put sound effects..
please make it easy to understand i am a beginner thank you!

Recommended Answers

All 9 Replies

I think the setOptions method of the JOptionPane might help you out there. just check the api's. another way is to create separate JFrames, that way you can code the entire layout, which might be easier in some cases: you'll have complete control over which element is where in your layout (for instance)

I think the setOptions method of the JOptionPane might help you out there. just check the api's. another way is to create separate JFrames, that way you can code the entire layout, which might be easier in some cases: you'll have complete control over which element is where in your layout (for instance)

how about putting sound effects??

gui is not really related to sounds. I think that if you want to get that done, you'll have to create a JFrame with either a label and/or an input field, some buttons, ... and you can always play a .wav file when pressing a button, or when opening or closing the JFrame

gui is not really related to sounds. I think that if you want to get that done, you'll have to create a JFrame with either a label and/or an input field, some buttons, ... and you can always play a .wav file when pressing a button, or when opening or closing the JFrame

sir.. do think that it will be hard for me to do that? can u give me some examples on doing that? thank you!

you mean playing a sound or creating a dialog using a JFrame?

you mean playing a sound or creating a dialog using a JFrame?

putting a sound on my program and playing it

not really, there are tons of examples out there, and wav (and some other formats) are default supported by java.

here's one link you might want to take a look at.

haven't tested this code myself at this point, but I doubt it 'll fail. if you would want to play .mp3 files, I suggest you look into the Java Media Framework, or JLayer, which might be a bit more difficult to work with.

not really, there are tons of examples out there, and wav (and some other formats) are default supported by java.

here's one link you might want to take a look at.

haven't tested this code myself at this point, but I doubt it 'll fail. if you would want to play .mp3 files, I suggest you look into the Java Media Framework, or JLayer, which might be a bit more difficult to work with.

ohh thanks thank you! ur the best ! hahaa!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.