本文整理了Java中javax.swing.JSlider.setMaximum()
方法的一些代码示例,展示了JSlider.setMaximum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.setMaximum()
方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:setMaximum
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void updateTime(){
int max = (int) (musicLength * 100);
int pos = (int) (curTime * 100);
sldBar.setMaximum(max);
sldBar.setValue(pos);
int minutesTotal = (int) (musicLength / 60);
int secondsTotal = (int) (musicLength % 60);
int minutesNow = (int) (curTime / 60);
int secondsNow = (int) (curTime % 60);
String txt = String.format("%01d:%02d-%01d:%02d", minutesNow, secondsNow,
minutesTotal, secondsTotal);
lblTime.setText(txt);
}
代码示例来源:origin: MovingBlocks/Terasology
public PropertySlider() {
titledBorder = new TitledBorder("");
setBorder(titledBorder);
borderLayout = new BorderLayout();
setLayout(borderLayout);
label = new JLabel("");
slider = new JSlider();
slider.setMinimum(0);
slider.setMaximum(100);
slider.setMinorTickSpacing(1);
slider.setMajorTickSpacing(10);
slider.addChangeListener(this);
add(slider, BorderLayout.CENTER);
add(label, BorderLayout.EAST);
}
代码示例来源:origin: osmdroid/osmdroid
sliMinZoom.setMaximum(22);
sliMinZoom.setMajorTickSpacing(1);
sliMinZoom.setMinorTickSpacing(1);
sliMaxZoom.setMaximum(22);
sliMaxZoom.setMinimum(0);
sliMaxZoom.setValue(10);
代码示例来源:origin: eu.mihosoft.vrl/vrl
/**
* @param maxValue the maxValue to set
*/
public void setMaxValue(Integer maxValue) {
this.maxValue = maxValue;
input.setMaximum(maxValue);
}
代码示例来源:origin: com.samskivert/samskivert
/**
* Sets the slider's maximum value.
*/
public void setMaximum (int maximum)
{
_slider.setMaximum(maximum);
}
代码示例来源:origin: magefree/mage
tooltipDelay.setMaximum(5000);
tooltipDelay.setMinorTickSpacing(100);
tooltipDelay.setPaintLabels(true);
sliderFontSize.setMaximum(50);
sliderFontSize.setMinimum(10);
sliderFontSize.setMinorTickSpacing(1);
sliderChatFontSize.setMaximum(50);
sliderChatFontSize.setMinimum(10);
sliderChatFontSize.setMinorTickSpacing(1);
sliderDialogFont.setMaximum(50);
sliderDialogFont.setMinimum(10);
sliderDialogFont.setMinorTickSpacing(1);
sliderEditorCardSize.setMaximum(50);
sliderEditorCardSize.setMinimum(10);
sliderEditorCardSize.setMinorTickSpacing(1);
sliderEditorCardOffset.setMaximum(50);
sliderEditorCardOffset.setMinimum(10);
sliderEditorCardOffset.setMinorTickSpacing(1);
sliderEnlargedImageSize.setMaximum(50);
sliderEnlargedImageSize.setMinimum(10);
sliderEnlargedImageSize.setMinorTickSpacing(1);
sliderCardSizeHand.setMaximum(50);
代码示例来源:origin: Mine-and-blade-admin/Battlegear2
@Override
public void stateChanged(ChangeEvent e) {
JSlider source = (JSlider)e.getSource();
y2slider.setMaximum(source.getValue());
resetImage();
}
});
代码示例来源:origin: Mine-and-blade-admin/Battlegear2
@Override
public void stateChanged(ChangeEvent e) {
JSlider source = (JSlider)e.getSource();
x2slider.setMaximum(source.getValue());
resetImage();
}
});
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public void stateChanged(ChangeEvent ce) {
m_plotSizeLb.setText("PlotSize: [" + m_plotSize.getValue() + "]");
m_plotSizeLb.setPreferredSize(m_plotLBSizeD);
m_jitter.setMaximum(m_plotSize.getValue() / 5); // 20% of cell Size
m_regenerateOSI = true;
}
});
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-mobility-svgcore
private void updateAnimationTime(float time, float maxTime) {
currentTimeSpinner.removeChangeListener(changeListener);
slider.removeChangeListener(changeListener);
if (maxTime != -1) {
slider.setMaximum(Math.round(maxTime / SLIDER_DEFAULT_STEP));
}
slider.setValue(Math.round(time / SLIDER_DEFAULT_STEP));
time = Math.round(time * 10) / 10.0f;
currentTimeSpinner.setValue(new Float(time));
slider.addChangeListener(changeListener);
currentTimeSpinner.addChangeListener(changeListener);
}
代码示例来源:origin: senbox-org/s1tbx
public void updateControls() {
final int currentRecord = polarView.getCurrentRecord();
final int numRecords = polarView.getNumRecords();
prevBtn.setEnabled(currentRecord > 0 && !animate);
nextBtn.setEnabled(currentRecord < numRecords && !animate);
recordSlider.setMinimum(0);
recordSlider.setMaximum(polarView.getNumRecords());
recordSlider.setValue(currentRecord);
recordLabel.setText("Record " + (currentRecord + 1) + " of " + (numRecords + 1));
}
代码示例来源:origin: com.hazelcast.simulator/visualizer
@Override
public void stateChanged(ChangeEvent e) {
int value = mainHorizontalSlider.getValue();
plot.getDomainAxis().setUpperBound(value);
plot.getDomainAxis().setLowerBound(0);
fineHorizontalSlider.setMaximum(value);
fineHorizontalSlider.setValue(value);
}
});
代码示例来源:origin: org.ihtsdo/wb-api
private void updateFineControl() {
if (this.fineControl != null) {
this.fineControl.setMaximum(getFineControlMax());
this.fineControl.setMinimum(getFineControlMin());
this.fineControl.setValue(this.coarseControl.getValue());
updateFineControlLabelTable();
}
}
代码示例来源:origin: com.hazelcast.simulator/visualiser
@Override
public void stateChanged(ChangeEvent e) {
int value = mainHorizontalSlider.getValue();
plot.getDomainAxis().setUpperBound(value);
plot.getDomainAxis().setLowerBound(0);
fineHorizontalSlider.setMaximum(value);
fineHorizontalSlider.setValue(value);
}
});
代码示例来源:origin: stackoverflow.com
JSlider slider = new JSlider();
slider.setMinimum(0);
slider.setMaximum(100);
slider.setMajorTickSpacing(10);
slider.setMinorTickSpacing(2);
slider.setPaintTicks(true);
代码示例来源:origin: robo-code/robocode
private JSlider createBattlefieldSizeSlider() {
JSlider slider = new JSlider();
slider.setMinimum(MIN_BATTLEFIELD_SIZE);
slider.setMaximum(MAX_BATTLEFIELD_SIZE);
slider.setMajorTickSpacing(BATTLEFIELD_STEP_SIZE);
slider.setSnapToTicks(true);
slider.setPaintTicks(true);
return slider;
}
代码示例来源:origin: pvto/konte-art
private void setRndCharSlider(String s)
{
this.rndCharN = s.length();
this.jSlider1.setMinimum((int) randomFeed.convertKey(Misc.replicate("A", rndCharN)));
this.jSlider1.setMaximum((int) randomFeed.convertKey(Misc.replicate("Z", rndCharN)));
this.jSlider1.setValue((int) randomFeed.convertKey(s));
}
代码示例来源:origin: jzy3d/jzy3d-api
protected JSlider createSlider(final String title, int min, int max){
final JSlider slider = new JSlider();
slider.setMinimum(min);
slider.setMaximum(max);
slider.setMajorTickSpacing(20);
slider.setMinorTickSpacing(5);
slider.setPaintTicks(true);
slider.setPaintLabels(true);
return slider;
}
代码示例来源:origin: senbox-org/snap-desktop
private void updateUiState() {
if (!isInitialized) {
return;
}
int numRecords = plotSettings.getNumRecords();
recordSlider.setMaximum(numRecords);
configureSilderLabels(recordSlider);
numRecSpinnerModel.setMaximum(numRecords);
plotSettings.getContext().setComponentsEnabled(PROP_NAME_RECORD_START_INDEX, numRecords > 1);
plotSettings.getContext().setComponentsEnabled(PROP_NAME_RECORDS_PER_PLOT, numRecords > 1);
recordValueField.setEditable(numRecords > 1);
}
代码示例来源:origin: net.java.abeille/abeille
public JETABean createBean(String compName, boolean instantiateBean, boolean setDefaults) throws FormException {
JETABean jbean = super.createBean(compName, instantiateBean, setDefaults);
Component comp = jbean.getDelegate();
if (comp instanceof JSlider && setDefaults) {
JSlider slider = (JSlider) comp;
slider.setMajorTickSpacing(20);
slider.setMaximum(100);
slider.setPaintTicks(true);
slider.setPaintLabels(true);
}
return jbean;
}
}
内容来源于网络,如有侵权,请联系作者删除!