0

ImageIconJDialogボックスに表示するURLパスで指定された画像を作成しようとしています。ボックスは表示されていますが、画像は MIA です。デバッグを通じて URL が正しいことはわかっていますが、正しく割り当てられていないと思います。Samplerここに私がこれまでに持っているものがあります: アクションボタンを介してJDialog ボックスクラスを呼び出します:

sample.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e)
{
cator comun = new cator();
comun.hostname=b_state.hostname;
comun.port=b_state.portnumber;
String url=comun.get_Simage(b_state.current_user.getUser_name(),    b_state.current_user.getPassword(), 1);
Sampler samp=new Sampler(url, b_state);

samp.pack();
samp.setVisible(true);
}
});

実際の Sampler クラス コードは次のとおりです。

public Sampler(String url, BatchState b_state) {  
    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    setTitle("Image Loading Demo");
    String final_url=b_state.urlMaker(url);
    System.out.println("url is " + final_url);
    ImageIcon image=new ImageIcon(final_url);
    JLabel erroneous= new JLabel(image);
    erroneous.setIcon(image);
    add(erroneous);

    pack();
    setLocationByPlatform(true);    
}

BatchState私がずっと必要とする有用な情報だけを持っているオブジェクトです。助けてください。

4

0 に答える 0