Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button Action for Java Application

Status
Not open for further replies.

goatboy

Programmer
Aug 9, 2000
9
US
I am new to Java and am trying to write a simple (or at least I thought it was) desktop application.

I have a frame (awt) which contains 2 panels. One panel contains two buttons. All I want to do is display a image in the other panel when a button is clicked and play a sound. This seems pretty straightforward but I can not find any references to it.

Any assistance would be appreciated.

Thanks
 
please construct two panels separatly
then take the layouts on each pane depends on your requirment. and populate the buttons add functionalities to it
it is very simple.
 
Greetings! I'm fairly new to Java and I was assign to work on a Login Screen, with three buttons (OK, Cancel, Clear). I'm extending a frame and the problem is the last button, (whatever I add last) disregards the setbound and is being resized to the size of the frame, so if I make the frame bigger or smaller, the last button goes with it. I'm sure there's a way to fix this, can anybody help me. Thank you very much.
 
goatboy
Perhaps you forgot to call repaint() in your Pane class.. for the picture.. My guess is that you have some type of error in your Event Listeners that are not triggering the code connected to the buttons.. oh.. swing would be better to use....

miketb69
What you will need to do is look code on Custom Event managers, or you can seperate you program into seperate panels, or you can look at proj6 that i did a while ago
good luck

ackka
ackka@mad.scientist.com
duke_wave.gif
Java is the Future
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top