![]() Internet browsers, such as Internet Explorer, Chrome, and Firefox.Ī pointing device, such as the mouse, interacts with nearly all aspects of the GUI.Any Microsoft program, including Word, Excel, and Outlook.Early command line operating systems like MS-DOS and some versions of Linux today have no GUI interface. Linux variants like Ubuntu use a GUI interface.What are examples of a GUI operating system? ![]() ![]() ![]() Because of their ease of use and more modern appearance, GUI operating systems are the primary type of operating systems used today. Additionally, users do not need to know any programming languages. Unlike a command-line operating system or CUI (command-line user interface), like Unix or MS-DOS, GUI operating systems are easier to learn and use because commands do not need to be memorized. What are the benefits of GUI?Ī GUI is considered to be more user-friendly than a text-based command-line interface, such as MS-DOS or the shell of Unix-like operating systems. With a command line interface, you need to know the commands to navigate to the directory containing the program, list the files, and then run the file. Although a GUI operating system is primarily navigated using a mouse, a keyboard can also be used via keyboard shortcuts or arrow keys.įor example, if you want to open a program on a GUI system, move the mouse pointer to the program's icon and double-click it. Window - Rectangular section of the computer's display that shows the program currently being used.Ī GUI uses windows, icons, and menus to perform commands, like opening, deleting, and moving files.Toolbar - A row of buttons, often near the top of an application window that controls software functions.Tab - Clickable area at the top of a window that shows another page or area.Ribbon - Replacement for the file menu and toolbar that groups program activities together.Menu bar - Thin, horizontal bar containing the labels of menus.Menu - List choices offered to the user through the menu bar.Kebab menu - A button with three dots that expands and shows a hidden menu when pressed.Icon - Small graphical representation of a program, feature, or file.Hamburger menu - A button with three lines that expands and shows a hidden menu when pressed.Dialog box - A type of window that displays additional information and asks a user for input.Button - A graphical representation of a button that acts as a program when pressed.Below are these elements with a brief description. To make a GUI as user-friendly as possible, there are different elements and objects that the user use to interact with the software. tDefaultCloseOperation(JFrame.For an example of a command line for comparison, see our command line page. Label = new JLabel("checkBox activated") Ĭb = new JCheckBox("check here", false) Private boolean checkedOnce // this boolean says if the checkBox is checked or not Public class tst implements ActionListener Import java.awt.* // for the checkBox and the label In this example a JCheckBox and a JLabel are added to a JFrame, so that the Label is only visible when the CheckBox is activated. To add more components to a frame, add them to a Container, and set a flowLayout, like this: This Item will take up all the window room. Notice that you can only add one Item to a window. This allows to update something else immediately when the box state changes. JCheckBox also fires an action event when changing the state, so it is possible to register an action listener for it, same as for a button. To figure out if it is activated, you need to call its method isSelected(). JCheckBox checkBox = new JCheckBox("name") Is a widely known on/off switch, common in many user interfaces. Then you should make a ActionPerformed method(see example) To figure out if a button is pressed you can write: Here are some examples (a full list for your JDK is in the java documentation):Ī simple label that cannot be pressed, and shows a piece of text. There are quite a lot of components in Java. You can also say setVisible(false), which you can use when you would like to remove a component from a frame (for example if you want a warning message to disappear). It is no use making a frame if it is not visible. The last statement sets the frame visible. there is also DO_NOTHING_ON_CLOSE, I think you can guess what this does. The third statement sets what happens when you press "x". The second statement sets the size and position of the frame, first the position(x,y) (in pixels) and the second the size(x,y) It is not necessary to give the frame a title, JFrame() works as well. Import java.awt.* import javax.swing.* // needed for frame creation public class testJFrame
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |