Hvad er der galt
Den vil ikke vise billedet...hvad er der galt med dette:
import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.net.URL;
public class MeasurementCardApplet extends JApplet{
private GridBagLayout layout;
private GridBagConstraints con;
private Image style;
private String styleUrl = "scm_signpost";
public void init(){
try{
style = getImage(getDocumentBase(), styleUrl);
}
catch(Exception x){
System.out.println("fejl: "+x);
}
layout = new GridBagLayout();
getContentPane().setLayout(layout);
JLabel ImageLabel = new JLabel();
ImageIcon II = new ImageIcon(style);
ImageLabel.setIcon(II);
con = nyGBC(1,1,1,1,0);
JPanel t = new JPanel();
t.add(ImageLabel, con);
con = nyGBC(2,2,2,2,0);
getContentPane().add(ImageLabel, con);
setVisible(true);
}
private GridBagConstraints nyGBC(int x, int y, int width, int height, int ins) {
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = x;
gbc.gridy = y;
gbc.gridwidth = width;
gbc.gridheight = height;
gbc.insets = new Insets(ins, ins, ins, ins);
return gbc;
}
}
