JAVA메모장소스
본 자료는 미리보기를 지원하지 않습니다.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
해당 자료는 5페이지 까지만 미리보기를 제공합니다.
5페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

JAVA메모장소스에 대한 보고서 자료입니다.

목차

교수님메모장보다 훨씬 깔끔하고 잘만들었따고
a+주신 메모장소스입니다 믿고 받아보세여^^

본문내용

import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.swing.*;
import java.io.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.undo.UndoManager;
public class JNotePad extends JFrame implements Printable, UndoableEditListener {
JTextPane _textPane;
private ActionMap _actionMap;
private boolean _isSaved = true;
private JFileChooser _fc = new JFileChooser(".");
private File _file = null;
private UndoManager undoManager=new UndoManager();
private FindDialog fd=new FindDialog(this);
private ChangeDialog cd=new ChangeDialog(this);
private FontDialog ftd=new FontDialog(this);
public void undoableEditHappened(UndoableEditEvent undoe)
{
if(undoManager !=null)
undoManager.addEdit(undoe.getEdit());
}
public void printPage()
{
PrinterJob pj=PrinterJob.getPrinterJob();
pj.setPrintable(this);
pj.pageDialog(pj.defaultPage());
}
public void printDocument()
{
try{
PrinterJob pj=PrinterJob.getPrinterJob();
pj.setPrintable(this);
pj.printDialog();
pj.print();
}catch(Exception e){}
}
public int print(Graphics g, PageFormat pf, int pi)throws PrinterException
{
if (pi >= 1)
{
return Printable.NO_SUCH_PAGE;
}
Graphics g2=(Graphics2D)g;
g2.translate((int)pf.getImageableX(),(int)pf.getImageableY());
this.paint(g2);
return Printable.PAGE_EXISTS;
}
private boolean confirmSave(){
if(_isSaved)
return true;
int ret =JOptionPane.showConfirmDialog(
this,
"저장하시겠습니까?",
"메모장", JOptionPane.YES_NO_CANCEL_OPTION );
switch(ret){
case JOptionPane.YES_OPTION:
save();
return true;
case JOptionPane.NO_OPTION:
return true;
default:
return false;
}
}
private class NewAction extends AbstractAction{
public NewAction() {
super("새글");
putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke("ctrl N"));
;
}
public void actionPerformed(ActionEvent e){
System.out.println(getValue(Action.NAME));
if(!confirmSave())
return;
_textPane.setText("");
_isSaved = true;
  • 가격2,500
  • 페이지수17페이지
  • 등록일2008.11.10
  • 저작시기2008.9
  • 파일형식기타(java)
  • 자료번호#490651
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니