Pastebin.vip
Create
Recent
Trending
About
Drop down box jcombobox, list box JList, scroll pane JScrollPane
From , 5 Years ago, written in Java, viewed 230 times.
URL
https://pastebin.vip/view/56468d56
Embed
—
Expand Paste
to full width of browser
/**
*功能:下拉框JComboBox,列表框 JList ,滚动窗格JScrollPane
*/
package
com.jiemian
;
import
java.awt.*
;
import
javax.swing.*
;
public
class
Text7
extends
JFrame
{
JPanel
jp1,jp2
;
JLabel
jl1,jl2
;
JComboBox
jcb
;
JList
jlist
;
JScrollPane
jsp
;
public
static
void
main
(
String
[
]
args
)
{
Text7 text7
=
new
Text7
(
)
;
}
public
Text7
(
)
{
//创建组件
jp1
=
new
JPanel
(
)
;
jp2
=
new
JPanel
(
)
;
jl1
=
new
JLabel
(
"你的籍贯"
)
;
jl2
=
new
JLabel
(
"旅游地点"
)
;
String
[
]
jg
=
{
"贺州"
,
"南宁"
,
"柳州"
,
"桂林"
,
"钦州"
,
"火星"
}
;
jcb
=
new
JComboBox
(
jg
)
;
String
[
]
dd
=
{
"九寨沟"
,
"天安门"
,
"故宫"
,
"长城"
,
"尧山"
,
"张家界"
}
;
jlist
=
new
JList
(
dd
)
;
jlist.
setVisibleRowCount
(
3
)
;
jsp
=
new
JScrollPane
(
jlist
)
;
//设置布局管理器
this
.
setLayout
(
new
GridLayout
(
2
,
1
)
)
;
//添加组件
jp1.
add
(
jl1
)
;
jp1.
add
(
jcb
)
;
jp2.
add
(
jl2
)
;
jp2.
add
(
jsp
)
;
this
.
add
(
jp1
)
;
this
.
add
(
jp2
)
;
//设置窗体属性
this
.
setSize
(
300
,
200
)
;
this
.
setTitle
(
"用户调查"
)
;
this
.
setIconImage
(
(
new
ImageIcon
(
"images
\\
head_boy.jpg"
)
)
.
getImage
(
)
)
;
this
.
setLocation
(
300
,
300
)
;
this
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
)
;
this
.
setVisible
(
true
)
;
}
}
Reply to "Drop down box jcombobox, list box JList, scroll pane JScrollPane"
Here you can reply to the paste above
Author
What's your name?
Title
Give your paste a title.
Language
What language is your paste written in?
Plain Text
HTML5
CSS
JavaScript
PHP
Python
Ruby
Lua
Bash
Erlang
Go
C
C++
Diff-output
LaTeX
SQL
XML
-----------------
4CS
MOS 6502
MOS 6502 Kick Assembler
MOS 6502 TASM/64TASS
Motorola 68000 Devpac Assembler
ABAP
Actionscript
ActionScript3
Ada
AIMMS
ALGOL 68
Apache
AppleScript
Apt sources.list
ARM Assembler
x86 Assembler
asymptote
ASP
autoconf
Autohotkey
AutoIT
AviSynth
Awk
BASCOM AVR
Basic4GL
BBCode
Brainfuck
BibTeX
BlitzBasic
BNF (Backus-Naur form)
Boo
C (for LoadRunner)
C for Macs
C with WiAPI
CAD DCL (Dialog Control Language)
AutoCAD/IntelliCAD Lisp
CFDG
ColdFusion
ChaiScript
Chapel
CIL (Common Intermediate Language)
Clojure
CMake
COBOL
CoffeeScript
C++ with WinAPI
C#
Cuesheet
D
Dart
DCS
DCL
DCPU/16 Assembly
Delphi (Object Pascal)
DIV
DOS
dot
E
ECMAScript
Eiffel
Email (mbox/eml/RFC format)
Enerscript
Euphoria
EZT
Formula One
Falcon
fo
Fortran
FreeBasic
FreeSWITCH
F#
GAMBAS
GDB
Genero
Genie
GNU Gettext .po/.pot
glSlang
GML
Gnuplot script
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9+
HTML 4.01 strict
Icon
Unoidl
INI
Inno Script
INTERCAL
Io
ISPF Panel
J
Java
Java 5
Job Control Language
jQuery 1.3
KLone with C
KLone with C++
Kotlin
Liberty BASIC
LDIF
Generic Lisp
LLVM
Locomotive Basic (Amstrad CPC series)
Logcat
Logtalk
LOLcode
@Formula/@Command
LotusScript
Lightwave Script
Linden Scripting
Motorola 68000 Assembler
MagikSF
Make
MapBasic
Matlab M-file
mIRC Scripting
MMIX Assembler
Modula-2
Modula-3
Microchip Assembler
MXML
MySQL
Nagios
NetRexx
newLISP
nginx
Nimrod
Nullsoft Scriptable Install System
Oberon-2
Objective-C
Objeck Programming Language
OCaml (Objective Caml)
GNU Octave M-file
OpenOffice.org Basic
ooRexx
Oracle 11i
Oracle 8
Delphi Prism (Oxygene)
Oz
ParaSail
PARI/GP
Pascal
PCRE
Per (forms)
Perl
Perl 6
OpenBSD packet filter
PIC16 Assembler
Pike
Pixel Bender 1.0
PL/I
Oracle 9.2 PL/SQL
PostgreSQL
Postscript
Povray
PowerBuilder (PowerScript)
PowerShell
ProFTPd
Progress
Prolog
Property
ProvideX
PureBasic
Python for S60
q/kdb+
QBasic/QuickBASIC
QML
Racket
Ruby (with Ruby on Rails Framework)
RBS Script
Rebol
Microsoft Registry Editor
Rexx
robots.txt
RPM Spec
R
Rust
SAS
Scala
Scheme
SciLab
SCL
sdlBasic
Smalltalk
Smarty template
SPARK
SPARQL
StandardML
StoneScript
SystemVerilog IEEE 1800-2009(draft8)
TCL/iTCL
Tera Term Macro
thinBasic
T-SQL
TypoScript
Unicon
UnrealScript
UPC
Urbi
Vala
Visual Basic
VB.NET
VBScript
Vedit macro language
Verilog
VHDL
Vim scripting
Visual FoxPro
Visual Prolog
Whitespace
Whois response (RPSL format)
WinBatch
XBasic
xorg.conf
Axapta/Dynamics Ax X++
YAML
ZiLOG Z80 Assembler
ZXBasic
Your paste
Paste your paste here
/** *功能:下拉框JComboBox,列表框 JList ,滚动窗格JScrollPane */ package com.jiemian; import java.awt.*; import javax.swing.*; public class Text7 extends JFrame{ JPanel jp1,jp2; JLabel jl1,jl2; JComboBox jcb; JList jlist; JScrollPane jsp; public static void main(String[] args) { Text7 text7=new Text7(); } public Text7(){ //创建组件 jp1=new JPanel(); jp2=new JPanel(); jl1=new JLabel("你的籍贯"); jl2=new JLabel("旅游地点"); String []jg={"贺州","南宁","柳州","桂林","钦州","火星"}; jcb=new JComboBox(jg); String []dd={"九寨沟","天安门","故宫","长城","尧山","张家界"}; jlist =new JList(dd); jlist.setVisibleRowCount(3); jsp=new JScrollPane(jlist); //设置布局管理器 this.setLayout(new GridLayout(2, 1)); //添加组件 jp1.add(jl1); jp1.add(jcb); jp2.add(jl2); jp2.add(jsp); this.add(jp1); this.add(jp2); //设置窗体属性 this.setSize(300, 200); this.setTitle("用户调查"); this.setIconImage((new ImageIcon("images\\head_boy.jpg")).getImage()); this.setLocation(300, 300); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } }
Create Shorturl
Create a shorter url that redirects to your paste?
Private
Private paste aren't shown in recent listings.
Delete After
When should we delete your paste?
Burn on reading
5 Minutes
1 Hour
1 Day
1 Week
1 Month
1 Year
Keep Forever
Spam protection
Type in the letters
Create
https://burned.cc - Burn After Reading Website