A
Adam gimli84.o2.pl
I suppose there are not more than 4 lines to add hovewer I have no
idea how they should look like, therefore I ask You for help.
There are Two applets in two files and i want to run each fron the
second one here is their code
first file
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
plik: MojAplet2.java
public class MojAplet2 extends JApplet
{
JButton przycisk;
MojAplet2b a ;
class ActListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==przycisk)
{
/*
I suppose the code which runs the second applet should be here
*/
}
}
}
private ActListener ActList = new ActListener() ;
public void init()
{
przycisk=new JButton("zmien");
przycisk.addActionListener(ActList) ;
getContentPane().setLayout(null);
getContentPane().add(przycisk);
przycisk.setBounds(30, 158, 300, 34);
}
}
and the second file: MojAplet2.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MojAplet2b extends JApplet
{
JButton przycisk;
MojAplet2b a ;
class ActListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==przycisk)
{
//something which will cause that the applet will end and return to
the
// parrent applet
}
}
}
private ActListener ActList = new ActListener() ;
public void init()
{
przycisk=new JButton("zmien");
przycisk.addActionListener(ActList) ;
getContentPane().setLayout(null);
getContentPane().add(przycisk);
przycisk.setBounds(30, 158, 300, 34);
}
}
Im really beginer and I would be gratefull for any help
Regards,
Adam Skrodzki
idea how they should look like, therefore I ask You for help.
There are Two applets in two files and i want to run each fron the
second one here is their code
first file
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
plik: MojAplet2.java
public class MojAplet2 extends JApplet
{
JButton przycisk;
MojAplet2b a ;
class ActListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==przycisk)
{
/*
I suppose the code which runs the second applet should be here
*/
}
}
}
private ActListener ActList = new ActListener() ;
public void init()
{
przycisk=new JButton("zmien");
przycisk.addActionListener(ActList) ;
getContentPane().setLayout(null);
getContentPane().add(przycisk);
przycisk.setBounds(30, 158, 300, 34);
}
}
and the second file: MojAplet2.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MojAplet2b extends JApplet
{
JButton przycisk;
MojAplet2b a ;
class ActListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==przycisk)
{
//something which will cause that the applet will end and return to
the
// parrent applet
}
}
}
private ActListener ActList = new ActListener() ;
public void init()
{
przycisk=new JButton("zmien");
przycisk.addActionListener(ActList) ;
getContentPane().setLayout(null);
getContentPane().add(przycisk);
przycisk.setBounds(30, 158, 300, 34);
}
}
Im really beginer and I would be gratefull for any help
Regards,
Adam Skrodzki