10/25/2022 0 Comments Real simple notepadJOptionPane.showMessageDialog( null, "Copy Text "+texts) Public void actionPerformed(ActionEvent ae) #Real simple notepad codePastedoc = new JMenuItem( "Paste Document") įontfamily = new JMenuItem( "Set Font Family") įontstyle = new JMenuItem( "Set Font Style") įontsize = new JMenuItem( "Set Font Size") įtDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) įor each option, we created a ActionListener and give the appropriate code for each.Ĭreate the ActionPerformed method and then give the command to perform the action. Remdoc = new JMenuItem( "Remove Document") Saveasdoc = new JMenuItem( "Save As Document") Ĭopydoc = new JMenuItem( "Copy Document") Savedoc = new JMenuItem( "Save Document") Opendoc = new JMenuItem( "Open Document") tSelectionMode(ListSelectionModel.SINGLE_SELECTION) String familyvalue= įont1= new Font( "Arial", Font.PLAIN,17) įtSelectionMode(ListSelectionModel.SINGLE_SELECTION) JMenuItem newdoc, opendoc, exit, savedoc, saveasdoc, copydoc, pastedoc, remdoc, fontfamily, fontstyle, fontsize, status Public class notepad extends KeyAdapter implements ActionListener, KeyListener The JFrame will lead to our Notepad class which will contain the Notepad code. We want a TextArea which is the area containing the file information and MenuBar containing the MenuItems like :- File, Edit and etc. Inside the notepad class, we will create our objects within notepad constructor. It runs inside the browser and works at client side.įirst we want to create a class : notepad. * package :- Applet is a special type of program that is embedded in the webpage to generate the dynamic content. The package provides many event classes and Listener interfaces for event handling. For example, click on button, dragging mouse etc. * package :- Changing the state of an object is known as an event. Java.awt.* package :- provides classes for AWT api such as TextField, Label, TextArea, RadioButton, CheckBox, Choice, List etc. For example, rvlet contains the classes and interfaces for running servlets, while javax.ejb is the standard extension for Enterprise JavaBeans. (Java X) The prefix used for a package of Java standard extensions. Java.util.* package :- contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes. Java.io.* package :- The java.io package contains nearly every class you might ever need to perform input and output (I/O) in Java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |