Search:

Type: Posts; User: DusteroftheCentury

Search: Search took 0.11 seconds.

  1. Replies
    10
    Views
    2,928

    Re: How Do i add pictures to a jframe?

    Ok, I understand.

    Ill go read the rules.

    Where exactly are they located?
  2. Replies
    10
    Views
    2,928

    Re: How Do i add pictures to a jframe?

    This should work.


    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;

    public class Class2 extends JFrame
  3. Replies
    10
    Views
    2,928

    Re: How Do i add pictures to a jframe?

    ImageIcon pic = new ImageIcon("Filename.extension");
    panel.add(new JLabel(pic));
    this.setVisible(true);

    This should work.
Results 1 to 3 of 3