#JSlider

e797. 显示JSlider的标记

Theslidersupportstwolevelsoftickmarks,majorandminor.Typically,theminortick-markspacingissmallerthanthemajortick-markspacing.Also,theminortick-markspacingisamult...
代码星球 ·2021-02-12

e799. 限制JSlider的数值在标记以内

Bydefault,theslidercantakeonanyvaluefromtheminimumtothemaximum.Itispossibletoconfiguretheslidertoallowonlyvaluesattickmarks(seee797显示JSlider的标记).Thisisdonebycal...

e795. 获得和设置JSlider的值

//Tocreateaslider,seee794创建JSlider组件//Getthecurrentvalueintvalue=slider.getValue();//Gettheminimumvalueintmin=slider.getMinimum();//Getthemaximumvalueintmax=sli...

e796. 设置JSlider的方向

Besidesbeingeitherhorizontalorvertical,aslidercanalsobeinverted.Aninvertedhorizontalslidermovesfromright-to-left.Aninvertedverticalslidermovesfromtop-to-bottom....
代码星球 ·2021-02-12

e798. 显示JSlider的标记标签

Thisexampledemonstrateshowtodisplaylabels(numericalvalues)atthemajorticks(seee797显示JSlider的标记).//Createahorizontalsliderthatmovesleft-to-rightJSliderslider=newJ...

e800. 监听JSlider的数值变化

//CreatehorizontalsliderJSliderslider=newJSlider();//Registerachangelistenerslider.addChangeListener(newChangeListener(){//Thismethodiscalledwhenevertheslider's...

e794. 创建JSlider组件

//Createahorizontalsliderwithmin=0,max=100,value=50JSliderslider=newJSlider();//Createahorizontalsliderwithcustomminandmax;valueissettothemiddleintminimum=-255;...
代码星球 ·2021-02-12