waktu itu bikin gui iseng iseng (maklum newbie) kok masih eror ya? ini source codenya:
package gui.iseng;
import java.awt.*;
import javax.swing.*;
public class GUIgambar extends JFrame {
private ImageIcon image1;
private JLabel label1;
private ImageIcon image2;
private JLabel label2;
public GUIgambar(){
setLayout(new FlowLayout());
image1 = new ImageIcon(getClass().getResource("k.jpg"));
label1 = new JLabel (image1);
add(label1);
image2 = new ImageIcon(getClass().getResource("kl.jpg"));
label2 = new JLabel (image2);
add(label2);}
public static void main(String[] args) {
GUIgambar gui = new GUIgambar();
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gui.setVisible(true);
gui.pack();
gui.setTitle("Image Program");
} }
0 jempol
zeek
29
2
·
11 tahun, 9 bulan yang lalu
·
1 jempol
Guys, ini PHP + Javascript. Bukan Java. Java itu beda dengan Javascript, Javascript itu anti-pattern.