수다닷컴

  • 해외여행
    • 괌
    • 태국
    • 유럽
    • 일본
    • 필리핀
    • 미국
    • 중국
    • 기타여행
    • 싱가폴
  • 건강
    • 다이어트
    • 당뇨
    • 헬스
    • 건강음식
    • 건강기타
  • 컴퓨터
    • 프로그램 개발일반
    • C언어
    • 비주얼베이직
  • 결혼생활
    • 출산/육아
    • 결혼준비
    • 엄마이야기방
  • 일상생활
    • 면접
    • 취업
    • 진로선택
  • 교육
    • 교육일반
    • 아이교육
    • 토익
    • 해외연수
    • 영어
  • 취미생활
    • 음악
    • 자전거
    • 수영
    • 바이크
    • 축구
  • 기타
    • 강아지
    • 제주도여행
    • 국내여행
    • 기타일상
    • 애플
    • 휴대폰관련
  • 프로그램 개발일반
  • C언어
  • 비주얼베이직

[질문] 자바에서 내부 프레임 사용시 문제점(스윙)

큰깃

2023.04.01

다이어리 프로그램을 만들고 있습니다.

메뉴를 툴바로 넣었습니다.

그리고 툴바의 메뉴를 누르면 내부 프레임으로 창이 뜹니다.
그런데 문제가
내부 프레임을 끄지 않고 새로운 프레임을 띄우면

이상한 잔상이 생깁니다.

어떠한 잔상이냐 하면 새로운 프레임에서 입력등을 하려고 프레임을 클릭하면 예전에 떠 있던 프레임이 나타나고

다이얼로그를 띄우면 또 잔상이 생깁니다.
ㅜㅗㅜ
도저히 못고치겠습니다.

무슨 이유인지라도 알면 좋겠는데, 이유도 모르겠습니다.
도와주세요...엉엉엉....

------------------일부 소스-----------------
public NameCard() {JDesktopPane desktopPane = new JDesktopPane();JInternalFrame internalFrame = new JInternalFrame(title,true,true,true,true);
.

.

.

.

internalFrame.setSize(1024,650);

desktopPane.add(internalFrame);

Schedule.frame.getContentPane().add(desktopPane, BorderLayout.CENTER);

internalFrame.setVisible(true);

internalFrame.addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameClosing(InternalFrameEvent e){System.out.println(내부프레임을 닫습니다:); }});
} //NameCard의 생성자쪽에서 인터널 프레임을 설정해 주고요. 여기서는 인터널 프레임 설정은 이것뿐입니다.다른 클래스에서 NameCard를 불러오는 형식입니다.

큰 틀은 아래 소스 입니다..
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.beans.*;

public class Schedule extends JFrame implements ActionListener{

public static JFrame frame;
public static boolean daily = false;
public static String id = vvv;//public NameCard nc;private int index=0;
private JToolBar toolbar1;
private JButton button1, button2, button3, button4, button5, button6, button7, button8;
private Container contentPane;public Schedule(String title) {

super(title);

contentPane = this.getContentPane();

toolbar1 = new JToolBar();

ImageIcon calender= new ImageIcon(img/calender.gif);//월간스케줄버튼
ImageIcon month= new ImageIcon(img/month.gif);//월간누름
ImageIcon sc03 = new ImageIcon(img/sc03.gif);//일간스케줄버튼
ImageIcon day= new ImageIcon(img/day.gif);//일간누름
ImageIcon namecard= new ImageIcon(img/namecard.gif);//명함관리버튼
ImageIcon namecard01= new ImageIcon(img/namecard01.gif);//명함관리글
ImageIcon money= new ImageIcon(img/money.gif);//지출관리버튼
ImageIcon money01= new ImageIcon(img/money01.gif);//지출관리글
ImageIcon TSM= new ImageIcon(img/TSM.gif);//ABOUT TSM버튼
ImageIcon tsm01= new ImageIcon(img/TSM01.gif);//ABOUT TSM글
ImageIcon LOCK= new ImageIcon(img/LOCK.gif);//LOCK글
ImageIcon lock01= new ImageIcon(img/lock01.gif);//LOCK버튼
ImageIcon user= new ImageIcon(img/USER01.gif);//사용자관리 버튼
ImageIcon user01= new ImageIcon(img/user.gif);//사용자관리 글
ImageIcon code01= new ImageIcon(img/code.gif);//CODE 버튼
ImageIcon code02= new ImageIcon(img/code01.gif);//CODE 글

button1 = makeButton(img/calender.gif,월간스케줄);
button1.setPressedIcon(month);
button1.setToolTipText(월간스케줄);
button2 = makeButton(img/sc03.gif,일간스케줄);
button2.setPressedIcon(day);
button2.setToolTipText(일간스케줄);
button3 = makeButton(img/namecard.gif,명함관리);
button3.setPressedIcon(namecard01);
button3.setToolTipText(명함관리);
button4 = makeButton(img/money.gif,지출관리);
button4.setPressedIcon(money01);
button4.setToolTipText(지출관리);
button5 = makeButton(img/USER01.gif,사용자관리);
button5.setPressedIcon(user01);
button5.setToolTipText(사용자관리);
button6 = makeButton(img/lock01.gif,LOCK);
button6.setPressedIcon(LOCK);
button6.setToolTipText(LOCK);
button7 = makeButton(img/code.gif,코드관리);
button7.setPressedIcon(code02);
button7.setToolTipText(코드관리);
button8 = makeButton(img/TSM.gif,AboutTSM);
button8.setPressedIcon(tsm01);
button8.setToolTipText(AboutTSM);toolbar1.add(button1);
toolbar1.add(button2);
toolbar1.add(button3);
toolbar1.add(button4);
toolbar1.add(button5);
toolbar1.add(button6);
toolbar1.add(button7);
toolbar1.add(button8);/* 컴포넌트 추가 */

this.getContentPane().add(toolbar1, BorderLayout.NORTH);

setSize(1024,700);
setVisible(true);
&nbs
}

public JButton makeButton(String imagePath, String actionCommand) {
JButton b = new JButton(new ImageIcon(imagePath));
b.setActionCommand(actionCommand);
b.addActionListener(this);

return b;
}public void actionPerformed(ActionEvent e) {

String n = e.getActionCommand();

if (n.equals(월간스케줄)) {

MonthPlan mp = new MonthPlan(월간스케줄);
}else if (n.equals(일간스케줄)) {
DailyFrame mk = new DailyFrame(일간스케줄); }

else if (n.equals(명함관리)) {

NameCard nc = new NameCard(명함관리); }

else if (n.equals(코드관리)) {

CodeManagement cm = new CodeManagement(코드관리); }

else if (n.equals(지출관리)) {

Money mm = new Money(지출관리); }

else if (n.equals(사용자관리)) {

//CodeManagement cm = new CodeManagement(사용자관리);
}

else if (n.equals(AboutTSM)) {

AboutTSM at = new AboutTSM(AboutTSM); }

else if (n.equals(LOCK)) {

Lock lock = new Lock(); }

}//end of actionPerformedpublic static void main(String[] args) {

frame = new Schedule(TSM);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

신청하기





COMMENT

댓글을 입력해주세요. 비속어와 욕설은 삼가해주세요.

  • 한국녀

    네..수정해서 소스도 적었어요..^ㅡ^;;

  • 두루

    소스를 살짝 보여주심, 고수님들이 많이 답변 해주시지 않을까 생각합니다. ^^

번호 제 목 글쓴이 날짜
2699296 동영상 배경 질문드려요!!!!!!!!!!!!!! 핫파랑 2025-06-24
2699214 position:fixed 에 대한 질문입니다.. (7) 사이 2025-06-24
2699183 제이쿼리 이미지 슬라이드 위치값 수정 초엘 2025-06-23
2699153 테마[ADORABLE]에서 페이지생성시 하위페이지는 2개밖에 안되나요? 흰여울 2025-06-23
2699129 네이버 블로그 또는 사이트의 글을 불러오기 갤원 2025-06-23
2699070 탭메뉴처럼 셀렉트 박스를 이용해서 내용을 출력할 수 있는 방법이 있을까요. (3) 큰꽃늘 2025-06-22
2699016 인터넷이 안되는 환경에서 validator설치방법 (3) 은송이 2025-06-22
2698988 대체 C++ 6.0 exe 아이콘은 어떻게 넣는건가요? 외국녀 2025-06-22
2698960 음성파일을 embed로 작업했는데..웹 표준코딩으로 변경하려면 어떻게 해야하나요? (1) 잎새 2025-06-21
2698932 메뉴목록 풍선창 만들기 html (2) 하늘이 2025-06-21
2698901 http://www.zeitgeistbot.com/ 이 사이트처럼 움직이는 효과를 무엇이라고 하나요? 누림 2025-06-21
2698876 table width값 크로스브라우징에 대한 문의 (2) 볼수록매력 2025-06-21
2698849 c언어 질문. (3) 아름나 2025-06-20
2698823 setInterval 이벤트 제거 하려면... 가온길 2025-06-20
2698796 이 오류를 이해를 못하겠어요 Addicted 2025-06-20
2698712 IF 문 이 계속 오류가 나요 (2) 옆집오빠야 2025-06-19
2698687 이미지를 클릭하면 그 이미지를 다운받게해주는 방법 질문요 ^^ (미해결) (5) 해지개 2025-06-19
2698663 상속하면 자꾸 class 이름이 애러가 나네요 (2) 미련곰탱이 2025-06-19
2698637 마크업 질문요~~ (6) 바르고 2025-06-18
2698551 게시판폭보다 큰 이미지올릴때 어떻게 하시는지요 (9) 에드문드 2025-06-18
<<  이전  1 2 3 4 5 6 7 8 9 10  다음  >>

수다닷컴 | 여러분과 함께하는 수다토크 커뮤니티 수다닷컴에 오신것을 환영합니다.
사업자등록번호 : 117-07-92748 상호 : 진달래여행사 대표자 : 명현재 서울시 강서구 방화동 890번지 푸르지오 107동 306호
copyright 2011 게시글 삭제 및 기타 문의 : clairacademy@naver.com