Hi Chantal Ackermann,
Here I'm providing the code so that it wuld be useful for u to suggest me regarding this doubt.
import java.awt.*;
import javax.swing.*;
public class Frame1 extends JFrame {
private JLabel jLabel1;
JLabel jLabel2;
JLabel jlabel3;
public Frame1() {
try {
instanceCreation();
propertiesSet();
}
catch(Exception e) {
e.printStackTrace();
}
}
public void instanceCreation()
{
jLabel1 = new JLabel();
jLabel2 = new JLabel();
jlabel3=new JLabel();
}
private void propertiesSet() throws Exception {
jLabel1.setBounds(new Rectangle(121, 86, 73, 75));
jLabel1.setPreferredSize(new Dimension(73,75));
jLabel1.setVerticalAlignment(javax.swing.SwingConstants.VERTICAL);
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.HORIZONTAL);
jLabel2.setText("jLabel1");
jLabel2.setBounds(new Rectangle(1, 1, 73, 75));
jLabel2.setPreferredSize(new Dimension(73,75));
jLabel2.setVerticalAlignment(javax.swing.SwingConstants.VERTICAL);
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.HORIZONTAL);
jlabel3.setBounds(new Rectangle(200, 86, 80, 85));
jlabel3.setPreferredSize(new Dimension(80,85));
jlabel3.setVerticalAlignment(javax.swing.SwingConstants.VERTICAL);
jlabel3.setHorizontalAlignment(javax.swing.SwingConstants.HORIZONTAL);
java.awt.Font f=new java.awt.Font("Sansserif",Font.PLAIN,15);
jLabel1.setFont(f);
jLabel1.setForeground(new Color(0,35,3));
java.awt.Font f1=new java.awt.Font("Sansserif",Font.PLAIN,15);
jLabel2.setFont(f1);
jLabel2.setForeground(new Color(0,35,3));
jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.blue,3));
jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.red,3));
jlabel3.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.cyan,3));
jLabel1.setText("<html>1234567890 1234567890 1234567890 1234567890</html>");
jLabel2.setText("<html>123456789 123456789 123456789 123456789</html>");
jlabel3.setText("<html>1234567890 1234567890 1234567890 1234567890</html>");
this.getContentPane().setLayout(null);
this.getContentPane().add(jlabel3,null);
this.getContentPane().add(jLabel1, null);
this.getContentPane().add(jLabel2, null);
}
public static void main(
String args[])
{
Frame1 fr=new Frame1();
fr.setSize(300,300);
fr.setVisible(true);
}
}
Awaiting for u'r reply.
Thanks & Regards,
Nivedita.