My Notepad
I have spent near more two weeks to write this Notepad application. At this moment,I want to share with you. I wonder that do you know the Notepad in Windows XP/7. If you have no idea,I am pleasure to display the Notepad? in Windows 7 with you,and it displays as below: It has large future and simple interface,so does my Notepad! Well,I will introduce my Notepad. First,Let's look at the structure of the my Notepad application: =================================================The structure of the project:================================================= ??-src/main/java? ? ? ?-com.b510.notepad? ? ? ? ? ? ? -client? ? ? ? ? ? ? ? ? ?-Client.java? ? ? ? ? ? ? -common? ? ? ? ? ? ? ? ? ?-Common.java? ? ? ? ? ? ? -ui? ? ? ? ? ? ? ? ? ?-AboutUI.java? ? ? ? ? ? ? ? ? ?-FindManagerUI.java? ? ? ? ? ? ? ? ? ?-FontManagerUI.java? ? ? ? ? ? ? ? ? ?-FontSizeManagerUI.java? ? ? ? ? ? ? ? ? ?-JUI.java? ? ? ? ? ? ? ? ? ?-MainUI.java? ? ? ? ? ? ? ? ? ?-NotepadUI.java? ? ? ? ? ? ? ? ? ?-ReplaceManagerUI.java? ? ? ? ? ? ? ? ? ?-SkinManagerUI.java? ? ? ? ? ? ?-util? ? ? ? ? ? ? ? ? ?-EditMenuUtil.java? ? ? ? ? ? ? ? ? ?-FileMenuUtil.java? ? ? ? ? ? ? ? ? ?-FormatMenuUtil.java? ? ? ? ? ? ? ? ? ?-HelpMenuUtil.java? ? ? ? ? ? ? ? ? ?-NotepadUtil.java? ? ? ? ? ? ? ? ? ?-ViewMenuUtil.java? ? ? ? ? ? -log4j.properties ? ? ? ? ? ? -lib? ? ? ? ? ? ? ? ? -skin? ? ? ? ? ? ? ? ? ? ? ?-substance-1.0.jar? ? ? ? ? ? -pom.xml =================================================Describe for all files: ================================================= -Client.java --> The entry of the notepad application. It contains the main method. -Common.java --> All constants in here. -AboutUI.java --> About notepad page. -FindManagerUI.java --> Find page. -FontManagerUI.java --> Font setting page. -FontSizeManagerUI.java --> Font sizt setting page. -JUI.java --> The parent class for the NotepadUI,It extends JFrame. -MainUI.java --> The main page of the notepad. -NotepadUI.java --> The parent class for the MainUI,It extends JUI and implements ActionListener. -ReplaceManagerUI.java --> Replace page. -SkinManagerUI.java --> Skin setting page. -EditMenuUtil.java --> Edit menu functions provider. -FileMenuUtil.java --> File menu functions provider. -FormatMenuUtil.java --> Format menu functions provider. -HelpMenuUtil.java --> Help menu functions provider. -NotepadUtil.java --> Common functions provider. -ViewMenuUtil.java --> View menu functions provider. -log4j.properties --> A properties for the log4j. -substance-1.0.jar --> substance dependency. -pom.xml --> pom.xml =================================================How to add substance to your project build path?================================================= NOTE: Your computer should install the Maven(apache-maven-3.2.2 is good choice) before running this project!There are TWO ways to provided. 1. Using eclipse tool to add the substance-1.0.jar to project build path.? 1.1.Finding the substance-1.0.jar with the path "notepad/lib/skin/substance-1.0.jar".? ? ?Right Click --> Build Path --> Add to Build Path.? 1.2.Then open the opm.xml(with the path "notepad/pom.xml")? ? ? Deleting the substance dependency:? ? ? 2. Copy the substance-1.0.jar to your repository.? 2.1.Finding the substance-1.0.jar with the path "notepad/lib/skin/substance-1.0.jar". Copying the substance-1.0.jar file to your repository. The default path of the repository is "${user.home}/.m2/repository/org/jvnet/substance/substance/1.0/substance-1.0.jar" =================================================How to run notepad project?================================================= Using the eclipse tool and finding the Client.java file with the path "notepad/src/main/java/com/b510/notepad/client/Client.java". Right Click --> Run As --> Java Application ================== Some UIs Show ================== 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Change Skin =================================================Source Code:=================================================
MainUI ui = }
String HYPHEN = "-" String EMPTY = "" String NEW_LINE = "rn" String BLANK = " " String QUESTION_MARK = "?" String POINT = "." String COLOR = ":" String START = "*" String TXT = "txt" String TXT_FILE = START + POINT +
String UNTITLE = "Untitled" String NOTEPAD = "Notepad" String NOTEPAD_NOTEPAD = BLANK + HYPHEN + BLANK + String TITLE = UNTITLE + String SYSTEM_EXIT = "System exit" String SYSTEM_OPEN = "System open"
String FILE = "File" String EDIT = "Edit" String FORMAT = "Format" String VIEW = "View" String Help = "Help"
String NEW = "New" String OPEN = "Open..." String SAVE = "Save" String SAVE_AS = "Save as..." String PROPERTIES = "Properties" String EXIT = "Exit"
String UNDO = "Undo" String COPY = "Copy" String PASTE = "Paste" String CUT = "Cut" String DELETE = "Delete" String FIND = "Find..." String FIND_NEXT = "Find Next" String REPLACE = "Replace" String GO_TO = "Go To..." String SELECT_ALL = "Select All" String TIME_DATE = "Time/Date"
String WORD_WRAP = "Word Wrap" String RESET_FONT = "Reset Font" String FONT = "Font" String FONT_STYLE = "Font Style" String FONT_SIZE_TITLE = "Font Size" |