Friday, 28 June 2013

Add pictures in Jframe - #Netbeans #java

in this tutorial you can add a picture to JFrame in 5 steps.

  1. add text Editor to Jframe.
  2. right click --> properties.
  3. Click Icon --> Import to project.
  4. then click Ok.
  5. Click Edit text -- remove generated Text.

Using the code , you can do:

  1. jLabel1 = new javax.swing.JLabel();
  2. String icon_xpath = "jLabel4.icon";
  3. jLabel1.setIcon(icon_xpath); // NOI18N
  4. jform.Add(jLabel1);

No comments:

Post a Comment