Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Java Help non-HTML textpad

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya i need help i have a final and this is what i need to do i need to make 2 applets 1 is audio applet the other is a normal applet with shapes. what i have to do is when i click the play button on the audio applet it will make the other applet pop-up i really need something that will help me do this its for java textpad so it has nothing to do with URl please help its due soon or if theres any alternatives please let me know
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

I'm having trouble understanding what you're trying to say; it would help greatly if you edited your post to use punctuation.

As tu the problems: What do you have so far? If you haven't started yet, what ideas have you had? Where are you stuck implementing them?
davi dwarkasing
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya sorry to be typing bad i have 1 broken arm and its my bad arm. So i revised my program so that my audio applet opens a Jframe when i click the button now i need help so when i click on the button a image pops up in the jframe ill post the program. Also for welcoming me ill post the program sorry if its long

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;

public class Poke extends JApplet

private JButton playButton1;//playbutton for all the sounds
private JButton playButton;
private JButton playButton2;
private JButton playButton3;

private JLabel credit1;//labels
private JLabel credit;
private JLabel credit2;

private JButton stopButton1;//stopbutton for all the sounds
private JButton stopButton;
private JButton stopButton2;
private JButton stopButton3;

private AudioClip sound; // Holds the sound clip
private AudioClip sound1; // Holds the sound clip
private AudioClip sound2;
private AudioClip sound3;

public void init()
setLayout(new FlowLayout());

credit = new JLabel("Can't");

credit1 = new JLabel("Touch");

credit2 = new JLabel("Me");


sound = getAudioClip(getDocumentBase(), "Cantsound.wav");//Cant
sound1 = getAudioClip(getDocumentBase(), "Touchsound.wav");//touch
sound2 = getAudioClip(getDocumentBase(), "Mesound.wav");//me
sound3 = getAudioClip(getDocumentBase(), "Guy.wav");//fullsound

private void makeButtons()

playButton = new JButton("Play");
stopButton = new JButton("Stop");

playButton1 = new JButton("Play");
stopButton1 = new JButton("Stop");

playButton2 = new JButton("Play");
stopButton2 = new JButton("Stop");

playButton3 = new JButton("Play");
stopButton3 = new JButton("Stop");

playButton.addActionListener(new ButtonListener());
playButton1.addActionListener(new ButtonListener());
playButton2.addActionListener(new ButtonListener());
playButton3.addActionListener(new ButtonListener());

stopButton.addActionListener(new ButtonListener());
stopButton1.addActionListener(new ButtonListener());
stopButton2.addActionListener(new ButtonListener());
stopButton3.addActionListener(new ButtonListener());






private class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent e)

if (e.getSource() == playButton);
else if (e.getSource() == stopButton)

if (e.getSource() == playButton1);
else if (e.getSource() == stopButton1)

if (e.getSource() == playButton2);
else if (e.getSource() == stopButton2)

if (e.getSource() == playButton3);
else if (e.getSource() == stopButton3)


davi dwarkasing
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
part 2

image = getImage(getDocumentBase(), "Davi.gif");
JLabel label = new JLabel("");
getContentPane().add(label, BorderLayout.NORTH);

JPanel ControlPanel = new JPanel();

getContentPane().add(ControlPanel, BorderLayout.SOUTH);

JFrame d = new JFrame("Final Project YAY");

image = getImage(getDocumentBase(), "Body.gif");

public void paint(Graphics g){

public void update(Graphics g){


Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic