|
|
TopPage > Java関係 > Java関係[03] |
Project Name | :TabSample |
Package Name | :net.hobnote |
Class Name |
:SampleTabFrame (File->New->other==>WindowBuilder->Swing Designer->JFrameから) |
赤丸の辺りにJPanelを配置する感じで |
----> |
|
Project Name | :TestSpinner |
Package Name | :net.hobnote |
Class Name |
:TestSpinner (File->New->other==>WindowBuilder->Swing Designer->JFrameから) |
.... JSpinner spinner_int = new JSpinner(); spinner_int.setModel(new SpinnerNumberModel(1, // value 0, // min 11, // max 2 )); // step spinner_int.setBounds(220, 30, 120, 20); contentPane.add(spinner_int); ... |
.... JSpinner spinner_double = new JSpinner(); spinner_double.setModel(new SpinnerNumberModel(2.02, //value 1.01, //min 15.03, // max 1.14)); // step spinner_double.setBounds(220, 70, 120, 20); contentPane.add(spinner_double); ... |
.... JSpinner spinner_list = new JSpinner(); spinner_list.setModel(new SpinnerListModel(new String[] {"abc", "def", "ghi", "jkl", "mno", "pqr"})); // list spinner_list.setBounds(220, 110, 120, 20); contentPane.add(spinner_list); ... |
.... JSpinner spinner_date = new JSpinner(); spinner_date.setModel(new SpinnerDateModel(new Date(1457190000000L), // date value new Date(1457103600000L), // start new Date(1488639600000L), // end Calendar.DAY_OF_YEAR)); // calendar spinner_date.setBounds(220, 150, 120, 20); contentPane.add(spinner_date); ... |
.... Date now = new Date(); SpinnerDateModel model = new SpinnerDateModel(now, // value null, // min(効いていない感じ)? null, // max(効いていない感じ)? Calendar.DAY_OF_YEAR); // calendar(効いていない感じ) JSpinner spinner_date2 = new JSpinner(model); JSpinner.DateEditor editor = new JSpinner.DateEditor(spinner_date2, "yyyy.MM.dd"); spinner_date2.setEditor(editor); spinner_date2.setBounds(220, 190, 120, 20); contentPane.add(spinner_date2); ... |
TopPage > Java関係 > Java関係[03] |