in the GUI, such as JInternalFrame, JLayeredPane, JRootPane.Basic controls: Basic components of human-computer interaction, such as Jbutton, JcomboBox, Jlist, JMenu, JSlider, and JTextField.Information Display components: Components are displayed only for informational, but not editable, such as Jlabel, JProgressBar, and ToolTip.Edit information component: Displays to the user components that can be edited, such as JColorChooser, Jfilechoose, JFileCh
( i): basic interaction: A simple component that gets the user's input or display status. 1. Button (JButton): Text can prompt shortcut keys, can be placed relative to the icon, using ActionListener;2. check box (jcheckbox): You can select or cancel, use ItemListener, check box and radio button are the sub-classes of the toggle Jtogglebutton.3. Combo box (JCOMBOBOX): You can select one or self-editing from multiple options, use an array, collection, or model ComboBoxModel construct, through gets
set.Third, the tree collection to the data fileIv. file, change data, file---Tree set5) Physical Structure designFirst, the establishment of the data fileSecond, the construction of the character classThird, the construction tree integration as a collection of character classesFour, well-structured interactive interface6) system implementation and testingSimple one package, addresslisttreeset for tree setThe person class contains a collection of character attributesShowjframe Main interfaceDAT
Five layouts: Flow layout (flowlayout) boundary layout (borderlayout) grid layout (GridLayout) common three card layout (cardlayout) grid package layouts (gridbaglayout) Two types of JFrame that are not commonly used Form (default BorderLayout layout) JPanel panel (default flowlayout layout) JButton button Jradiobutton Radio box (be sure to place a single selection in Buttongroup to form mutual exclusion) Jcheckbox check box JLabel label JTextField text box JTextArea multiline text field (must b
. In the new Getlistcellrenderercomponent method, the parent object's method is still invoked first to complete the drawing of the normal entry, and then to determine if the entry is a Imagedcomboboxitem instance. If it does, it displays the Imagedcomboboxitem text, icon, and indents. To make it easier to display the left indent, we directly create a emptyborder and set the left indent quantity and set it to the Defaultlistcellrenderer. Defaultlistcellrenderer inherit from JLabel, so can directl
; Layout.setconstraints (J2, s); S.gridwidth=1; S.WEIGHTX= 0; S.weighty=0; Layout.setconstraints (J3, s); S.gridwidth= 0;//the method is to set the number of squares occupied by the component level, and if 0, it means that the component is the last of the rowS.WEIGHTX = 0;//cannot be a 4-1,j4 for a, and can be stretched horizontally,//However, if 1, the columns of the subsequent rows will also be stretched, causing the column where the J7 is to be stretched//so it should be str
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.