2014-09-01 11 views
0

이미지를로드하거나 JTextArea를 업데이트 할 때마다 항상 객체의 업데이트없이 프레임의 왼쪽 상단에 항상 새 객체/텍스트가 배치되는 응용 프로그램이 있습니다. 가정된다 .. 내가 이런 식으로 화면을 업데이트하는 이유 완전히 어안이 벙벙입니다이미지를 가져 와서 jLabels/jTextArea를 업데이트 할 때의 그래픽 이상

enter image description here enter image description here

는, 사람이를 변경하는 방법에 관한 힌트이나 조언을 않는 업데이트 할? 다음은

내가 당신을 그냥 잘못된 방법으로 그것을 사용하는 가정 나는 또한 GUI 건설의 정보를 추가해야하는 경우 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())); 
} 

확실으로의 JLabel을 추가하는 코드 ...

+1

코드를 보지 않고 질문에 답변 할 수 있다고 생각되는 이유는 무엇입니까? 질문에 코드를 게시하려면 [최소한의 완전하고 검증 가능한 예제를 만드는 방법] (http://stackoverflow.com/help/mcve)을 참조하십시오. – DavidPostill

+0

오, 죄송합니다. 누군가가 시각적으로 문제를 파악할 수는 있습니다. 즉, 위치를 설정하지 않고 이미지를 가져 오기. 프로그램으로 이미지를 가져 오는 것에 대해서는 위를 참조하십시오. – Millsie

+0

스레딩 문제이거나 레이아웃 관리자 문제이거나, 'paint' 또는'paintComponent' 메소드의 잘못된 구현 일 수 있습니다. 그러나 이런 종류의 추측은 당신을 도울 수 없을 것입니다 ... – Marco13

답변