fuadhamidov
Programmer
hi
i have developed an applet. in applet i need to show a number element on image.
so my applet include a JPanel which include a JLabel ( big image ) and a number of JButton ( elements ) on label .
while i call applet from browser i see ONLY label image.
why button image (or second label image ) is not seen?
if i put an animated image on button, they can seen in applet. otherwise i can't show them.
i have developed an applet. in applet i need to show a number element on image.
so my applet include a JPanel which include a JLabel ( big image ) and a number of JButton ( elements ) on label .
while i call applet from browser i see ONLY label image.
why button image (or second label image ) is not seen?
if i put an animated image on button, they can seen in applet. otherwise i can't show them.
Code:
package myproject.test;
public class JApplet extends javax.swing.JApplet {
public void init() {
initComponents();
}
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel(
new javax.swing.ImageIcon(
getClass().getResource( "/images/bigimage.gif" )
)
);
jButton1 = new javax.swing.JButton(
new javax.swing.ImageIcon(
getClass().getResource( "/images/e1.gif" )
)
);
jLabel2 = new javax.swing.JLabel(
new javax.swing.ImageIcon(
getClass().getResource( "/images/e2.gif" )
)
);
getContentPane().setLayout(null);
jPanel1.setLayout(null);
jLabel1.setOpaque(true);
jPanel1.add(jLabel1);
jLabel1.setBounds(0, 70, 370, 270);
jButton1.setOpaque(false);
jPanel1.add(jButton1);
jButton1.setBounds(270, 80, 42, 30);
jPanel1.add(jLabel2);
jLabel2.setBounds(80, 80, 0, 30);
getContentPane().add(jPanel1);
jPanel1.setBounds(0, 0, 370, 370);
}
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
}