This article is my own study notes, welcome reprint. But please specify the source:http://blog.csdn.net/jesson20121020
The list box and the JComboBox combo box are significantly different, which is not just the body's appearance today.When the JComboBox combo box is activated, a drop-down list appears, and JList always occupies a fixed line of space on the screen, and the size does not change.Suppose you want to get the selected item in the list
= new JPanel ();
JButton add = new JButton ();
JButton left = new JButton ();
JButton right = new JButton ();
JLabel label = new JLabel ();
JTextField field = new JTextField ();
Defaultlistmodel Leftmodel = new Defaultlistmodel ();
Defaultlistmodel Rightmodel = new Defaultlistmodel ();
JList leftlist = new JList (Leftmodel);
(); status. addItem (null); status. addItem ("coming soon"); status. addItem ("coming soon"); status. addItem ("dismounting ");
The display style is as follows:
2. list box (JList)
The list box only occupies a fixed size on the form. To make the list box scroll, you can put the list box into the scroll panel.
Parameters of the array initialization list box are as follows.
String[] contents = {"1", "2", "3"};JLi
This article is your own study notes, welcome reprint, but please indicate the source: http://blog.csdn.net/jesson20121020
The list box and the JComboBox combo box are significantly different, not just in appearance. When the JComboBox combo box is activated, a drop-down list appears, and JList always occupies a fixed line of space on the screen, and the size does not change. If you want to get the selected item in the list box, just call Getsele
To place a picture in the graphical interface, you need to use the window splitter JSplitPane (belonging to the container class component) to the interface above the imageicon. Split the window into two columns. A column is JList, inside entered some text, a column is jlable, above place the picture. The layout uses the Borderlayoutpackage gui;import java.awt.borderlayout;import javax.swing.jframe;import Javax.swing.jlabel;import Javax.swing.jsplitpan
Displays all files under the specified directory in the list box (JList) component,Following
Importjava.awt.BorderLayout;ImportJava.io.File;ImportJavax.swing.JComboBox;ImportJavax.swing.JFrame;Importjavax.swing.JList;ImportJavax.swing.JScrollPane; Public classKuang { Public Static voidListdrectory (File dir)throwsillegalaccessexception {JFrame frm=NewJFrame ("Drop down combo box"); Frm.setdefaultcloseoperation (Jframe.exit_on_close); Frm.
In the project, you need to use a drop-down tree to select a space. You have improved a lot by referring to other people. The usage is as follows:
Treecombobox TCB = new treecombobox (); you can create a simple drop-down tree. The drop-down tree is the original tree.
The source code of treecombobox is as follows:
Import java. AWT. borderlayout;Import java. AWT. color;Import java. AWT. component;Import java. AWT. dimension;Import java. AWT. illegalcomponentstateexception;Import java. AWT. event.
fromoperatorImportItemgetter#Itemgetter used to go to the key in Dict, eliminating the use of lambda functions fromItertoolsImportGroupBy#Itertool also contains a number of other functions, such as combining multiple lists together. d1={'name':'Zhangsan',' Age': 20,'Country':' China'}d2={'name':'Wangwu',' Age': 19,'Country':'USA'}d3={'name':'Lisi',' Age': 22,'Country':'JP'}d4={'name':'Zhaoliu',' Age': 22,'Country':'
.
1. Install the pymysql Module
pip3 install pymysql
2. Connect to the database and insert data instances
Import pymysql # generate an instance and connect to the database zclconn = pymysql. connect (host = '2017. 0.0.1 ', user = 'root', passwd = 'root', db = 'zcl') # generate a cursor. The current instance status is cur = conn. cursor () # insert data reCount = cur.exe cute ('insert into students (name, sex, age, tel, nal) values (% s, % s) ', ('jack', 'Man', 25, 1351234, "CN") reCount = cur.ex
theory of idle classes: torstan bend van burrun (USA 17th-1857)18th Ministry of Economic Development Theory, Joseph arth umpeter (Austria 1883-1950)19th Department of Welfare Economics Arthur CSIL pigou (UK 1877-1959)Joan Robinson (20th-1903, UK), part 2 of "Economics of Incomplete Competition)21st General Employment, interest and currency, John Mayard CAIRNS (UK 1883-1946)22nd value and capital, John Richard X (UK 1904-1989)Part 1 the road to slaver
; list = [1, 4, 3, 2, 5]
>>> jlist = json.dumps (list)
>>> Print JList
[1, 4, 3, 2, 5]
The list and jlist types are also different.
Copy Code code as follows:
>>> type (list)
>>> type (jlist)
Json.dumps has the following various parameters
Copy Code code as follows:
the wake-up mechanism is more energy-efficient than the existing periodic pause mechanism, and that lock-in and fast sleep also reduce network power consumption by 10% to 80% (depending on the wake-up frequency of the devices in the network).7 References[1] M. Buettner, G. Yee, E. Anderson, and R. han.x-mac:a Short preamble MAC protocol for dutycycled Wireless sensor NE Tworks. In Proceedings of the international Conference on Embedded networked Sensor Systems (ACM SenSys), Boulder,colorado,
; Jlist = json. dumps (list)>>> Print jlist[1, 4, 3, 2, 5]The list and jlist types are also different.Copy codeThe Code is as follows:>>> Type (list)>>> Type (jlist)
Json. dumps has the following parameters:Copy codeThe Code is as follows:Json. dumps (obj, skipkeys = False, ensure_ascii = True, check_circular = True, a
;>> jlist = json.dumps (list)
>>> Print JList
[1, 4, 3, 2, 5]
The list and jlist types are also different
Copy CodeThe code is as follows:
>>> type (list)
>>> type (jlist)
Json.dumps has the following various parametersCopy the Code code as follows:
Json.dum
list can be used as a json string
The code is as follows:
>>> List = [1, 4, 3, 2, 5]>>> Jlist = json. dumps (list)>>> Print jlist[1, 4, 3, 2, 5]
The list and jlist types are also different.
The code is as follows:
>>> Type (list)
>>> Type (jlist)
Json. dumps has the following parameters:
The c
MySQL learning footprint record 08 -- create a calculated field -- Concat (), AS bitsCN.com
MySQL learning footprint record 08 -- create a calculated field -- Concat (),
Table data used in this article
mysql> SELECT * FROM vendors;+---------+----------------+-----------------+-------------+------------+----------+--------------------------------------------+| vend_id | vend_name | vend_address | vend_city | vend_state | vend_zip | vend_country |+---------+----------------+---------
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.