본문 바로가기 메뉴 바로가기

MLog

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

MLog

검색하기 폼
  • All (99)
    • Linux (17)
      • Tomcat (1)
      • Ubuntu (7)
    • Java (13)
      • Swing (7)
      • Android (3)
      • Eclipse (5)
      • Spring (3)
      • POI (12)
    • Web (5)
      • Java Script (2)
      • CSS (0)
      • PHP (0)
      • HTML (2)
      • JSP (1)
    • Database (13)
      • MySQL (13)
    • Others (9)
    • Sales (0)
    • AVR (1)
    • Windows (7)
      • VBA 매크로 (2)
      • Excel (4)
    • 짤 (0)
    • 기기 (3)
  • 방명록

[Swing] JFrame의 exit()와 dispose()의 차이.

* 하나의 Frame에서 다른 Frame을 열어야 할 경우가 있는데 * 각각 Frame의 종료 이벤트가 Exit로 설정되어 있을경우 다른 창까지 모두 종료되기 때문에 * 원하는 하나의 Frame만 종료 시키기 위해서는 dispose() 메소드를 사용하여야 한다. "Show Another Frame" 버튼을 클릭하면 아래의 새 프레임이 생성된다. 위의 두 프레임이 생성되 있는 상황에서 "Dispose" 버튼을 클릭하면 해당 프레임만 사라지고 "Exit" 버튼을 클릭하면 두 프레임 모두 사라진다. public class Frame extends JFrame { public Frame() { setTitle("Difference between Exit and Dispose First Frame"); setSi..

Java/Swing 2011. 7. 15. 14:25
[Java] Text파일 라인 수 산출하기.

public class CountLineOfTextFile { public static void main(String[] args) { int lineCnt = 0; JFileChooser fc = new JFileChooser(); fc.showOpenDialog(null); File file = fc.getSelectedFile(); try { BufferedReader in = new BufferedReader(new FileReader(file)); while(in.readLine() != null) lineCnt++; } catch(Exception ex) {ex.printStackTrace();} System.out.println(lineCnt); } }

Java 2011. 7. 15. 14:22
[Swing] JScrollPane 스크롤 속도 설정하는 법.

public class Frame extends JFrame { public Frame() { setTitle("Control wheel speed of JScrollPane"); setSize(500, 500); getContentPane().setLayout(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JScrollPane jsp = new JScrollPane(); jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jsp.getVerticalScrollBar().setUnitIncrement(16);//스크롤 속도 jsp.setBorder(null);..

Java/Swing 2011. 7. 15. 14:17
이전 1 ··· 30 31 32 33 다음
이전 다음

Blog is powered by Tistory / Designed by Tistory

티스토리툴바