GUI (graphical User Interface) programming summary of Graphical interface
Java.Awt:Abstract Windows ToolKit (Abstract Window Toolkit)
Javax.swing:
Basic setup of graphical interface:
Set the form size: setSize (long, wide);
Set the form position: setlocation (distance from left, distance); SetBounds (long, wide, distan
construction Methods: Gauge (Parent,id,range=100,pos,size,style=ga_horizontal)Range refers to the value of an end point specified when the progress bar is loaded, and the program will confirm that the current progress bar should be more than full. The style specifies whether the load is loaded horizontally or vertically, and is loaded vertically ga_verticalUnlike some other components, it is not enough to construct the progress bar in the window alone, so the progress bar is static. The progres
Centos editing interface and GUI logon Switch Settings
Enter the command vi/etc/inittab.
Change 5 to 3 in the last row.
Save and exit.
Meanings of numbers:
#0-halt (donotsetinitdefadefatothis) Stop (no initdefault)
# 1-Singleusermode single-user mode
# 2-Multiuser, withoutNFS (Thesameas3, ifyoudonothavenetworking) multiple users without NFS (equivalent to 3 if you do not have a network)
# 3-Fullmultiuser
1. Query whether the graphical interface is installedYum Grouplist |moreIn the "Installed Groups:" section of the output of grouplist, if you can find "X Window System" and gnome desktop or KDE or XFCE-4.4, it proves that you have installed the desktop environment.2. Installation#yum groupinstall "X window System"#yum groupinstall "GNOME desktop Environment" or #yum groupinstall "KDE desktop".Uninstalling the GNOME desktop environment#yum groupremove
"Implementation Interface"AnalysisThe whole with default borderlayout (border layout), divided into upper and lower, respectively, with three JPanel storage;On: A picture, with JLabel;Under: Three buttons JButtonMiddle: Stored with a jtabbedpane (tab)Each option is a GridLayout (grid layout)Four JLabel, one JTextField, one jpassword, one JButton, two jcheckbox (check box)CodePackage Start;import java.awt.*;//must be introduced in two packages import J
Creating a GUI program in Java requires at least three types of objects:
* Component
* Events
* Listener
Pushcounter is a startup class and only displays a button (marked as "Push me !"), Press the button to update the counter to display the latest results.
// Pushcounter. Java// Demonstrate a graphical user interface and listener
Import javax. Swing. jframe;
Public class pushcounter {
// Create a presentat
VC + + feeling for the first time in 4408 under the guidance of the roommate to do the feeling is not very good today to the engine room to do a bit more handyVC + + began to lookWhat it looks like after a simple operationThe code I addedThe way we want to beLearning experience:I saw in many classmates the shadow of teacher he, this is a very special force in the leader we go forward, we need her.Week seventh project one-graphical user interface (
In this course design, most of the content is designed to be very smooth, did not encounter too much problem, but in the panel to join JTable did spend a part of the time, here to summarize the solution:To define a control:New JPanel (); JTable tablenew JScrollPane ();Define the two parameters in the JTable:New object[]{"Bus number", "Passenger capacity", "origin", "destination", "Departure Time", "Arrival Time", "Time required"}; // Column Name New OBJECT[50][7]; // number of rows, number of co
TextField (20);//Create a new text input window // Listen action, implement 7 actions in Windowadapter class, F.addwindowlistener in Java.awt.* package (new Windowadapter () {//close window to call public void Windowclosing (WindowEvent e) {System.out.println ("window closing-----" +e.tostring ()); System.exit (0);} Call public void Windowactivater (WindowEvent e) {System.out.println ("active") as soon as the window is activated;} Open the window and call public void windowopened (WindowEvent e
First, the layout1. ComponentsAn object that is graphically displayed on the screen, interacting with the user, is called a component.Components include: menus, labels, text boxes (password boxes), scroll bars, radio, check, buttons, and so on.2. ContainersComponents cannot be displayed independently, only the assembly can be placed in a container for normal display.Arranging and distributing components in a container in a reasonable and orderly manner, including the position and size of the com
This program displays two check boxes and one label. By changing the status of the check box, you can change the text format on the label to show the font in bold, italic, or bold italic.
The GUI Design in the styleoptions program is included in the styleoptionspanel class. The check box is represented by the jcheckbox class. When the check box changes from one status to another, the itemlistener event is generated. The itemlistener
Now we're starting to learn some interesting parts of GUI programming: applications that use dialogs as the primary interface. We'll cover this process in two separate classes. Theory: If you pay close attention to the previous program, you will find that you cannot press the TAB key to jump from one child window control to another, and if you want to move it, click it with a mouse. This is not friendly t
Configuration variables to define the color of the output information, otherwise the information will be displayed in yellowProgress output: Monitoring the status of long-running commandsWrite-processor call Writeprogress ()Output this type of information except through $host. privatedata.progress* Color Configuration variables to define the color of the output information, otherwise the information will be displayed in yellowSome commands only produce inflammation or debug information if you s
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.