0

画像をロードしたり JTextArea を更新したりするたびに、更新するはずのオブジェクトを単純に更新するのではなく、常にフレームの左上に新しいオブジェクト/テキストを配置するアプリケーションがあります..

ここに画像の説明を入力 ここに画像の説明を入力

このように画面を更新している理由に完全に唖然としています。これを変更する方法に関するヒントやヒントはありますか?

以下は、jLabel を jTabbedFrame に追加するためのコードです。

JLabel tempJLabel = new javax.swing.JLabel();
//tempJLabel.setLocation(1200,1200);
BufferedImage img = scaleImage(getStoredProductImage(photoDir[i]), 190); //scale down found image to whatever is needed
String filename = photoDir[i].getName();
Image tempImage = new Image(img,photoDir[i].getName(),photoDir[i],figureSaveDir(gtinTextBox.getText(), uidTextBox.getText()),tFrame,tempJLabel);       //create ImageObj for later use
if(filename.length()>20){
    tFrame.addTab(photoDir[i].getName().substring(15,19), tempJLabel);
    tempJLabel.setIcon(new ImageIcon(tempImage.getImg()));
}

GUI構成の情報も追加する必要があるかどうかわかりません...

4

1 に答える 1

0

間違った使い方をしているだけだと思います。
タブ レイアウトのスクリーンショットは、私には非常に奇妙に見えます。

しかし、多分私は間違っています (私は JTabbedFrame が何であるかを知りませんか?)

JTabbedPaneを意味する場合は、使用する前にhttp://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.htmlを読む必要があるかもしれません

于 2014-09-01T20:10:13.333 に答える