本文整理了Java中javax.swing.JSlider.setToolTipText()
方法的一些代码示例,展示了JSlider.setToolTipText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.setToolTipText()
方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:setToolTipText
暂无
代码示例来源:origin: lbalazscs/Pixelitor
static JSlider createSlider(float value, String toolTip) {
int intValue = (int) (value * 100);
JSlider slider = new JSlider(0, 100, intValue);
slider.setToolTipText(toolTip);
return slider;
}
}
代码示例来源:origin: magefree/mage
tooltipDelay.setPaintTicks(true);
tooltipDelay.setSnapToTicks(true);
tooltipDelay.setToolTipText("<HTML>The time the appearance of the tooltip window for a card is delayed.<br>\nIf set to zero, the tooltip window won't be shown at all.");
tooltipDelay.setValue(300);
sliderFontSize.setPaintTicks(true);
sliderFontSize.setSnapToTicks(true);
sliderFontSize.setToolTipText("<HTML>The size of the font used to display table text.");
sliderFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderFontSize.setMinimumSize(new java.awt.Dimension(150, 40));
sliderChatFontSize.setPaintTicks(true);
sliderChatFontSize.setSnapToTicks(true);
sliderChatFontSize.setToolTipText("<HTML>The size of the font used to display the chat text");
sliderChatFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderChatFontSize.setMinimumSize(new java.awt.Dimension(150, 40));
sliderDialogFont.setPaintTicks(true);
sliderDialogFont.setSnapToTicks(true);
sliderDialogFont.setToolTipText("<HTML>The size of the font of messages and menues");
sliderDialogFont.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderDialogFont.setMinimumSize(new java.awt.Dimension(150, 40));
sliderEditorCardSize.setPaintTicks(true);
sliderEditorCardSize.setSnapToTicks(true);
sliderEditorCardSize.setToolTipText("<HTML>The size of the card in editor and the picked zone of the draft panel");
sliderEditorCardSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderEditorCardSize.setMinimumSize(new java.awt.Dimension(150, 40));
代码示例来源:origin: codeminders/javadrone
private void updateSpeed(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_updateSpeed
float value = (float) maxSpeed.getValue() / 1000.0f;
maxSpeed.setToolTipText(value + "m/s");
maxSpeedLabel.setText("Vertical Speed (" + value + "m/s)");
}//GEN-LAST:event_updateSpeed
代码示例来源:origin: codeminders/javadrone
private void updateAlt(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_updateAlt
float value = (float) maxAltitude.getValue() / 1000.0f;
maxAltitude.setToolTipText(value + "m");
maxAltitudeLabel.setText("Max Altitude (" + value + "m)");
}//GEN-LAST:event_updateAlt
代码示例来源:origin: codeminders/javadrone
private void updateDeadZone(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_updateDeadZone
float value = (float) controllerDeadzone.getValue();
controllerDeadzone.setToolTipText(value + "%");
controllerDeadzoneLabel.setText("Controller Deadzone (" + value + "%)");
}//GEN-LAST:event_updateDeadZone
代码示例来源:origin: codeminders/javadrone
private void updateAngle(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_updateAngle
long value = Math.round(Math.toDegrees((float) maxAngle.getValue() / 100.0f));
maxAngle.setToolTipText(value + "");
maxAngleLabel.setText("Max Angle (" + value + "°)");
}//GEN-LAST:event_updateAngle
代码示例来源:origin: codeminders/javadrone
private void updateYaw(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_updateYaw
float value = Math.round(Math.toDegrees((float) maxYaw.getValue() / 100.0f));
maxYaw.setToolTipText(value + "°/s");
maxYawLabel.setText("Rotation Speed (" + value + "°/s)");
}//GEN-LAST:event_updateYaw
代码示例来源:origin: lbalazscs/Pixelitor
@Override
public void setToolTip(String tip) {
slider.setToolTipText(tip);
spinner.setToolTipText(tip);
}
代码示例来源:origin: jawi/ols
/**
* @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
*/
@Override
public void stateChanged( final ChangeEvent aEvent )
{
final JSlider slider = ( JSlider )aEvent.getSource();
final int before = slider.getValue();
final int after = ( slider.getMaximum() - before );
slider.setToolTipText( updateLabel( before, after ) );
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets
void showToolTip(MouseEvent e) {
int value = getSliderValue(e);
if (value == -1) {
return;
}
int h = value / 60;
int m = value % 60;
String text = "";
if (h < 10) {
text = "0";
}
text += h + " : ";
if (m < 10) {
text += "0";
}
text += m;
JSlider slider = (JSlider) e.getSource();
slider.setToolTipText(text);
}
};
代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget
void showToolTip(MouseEvent e) {
int value = getSliderValue(e);
if (value == -1) {
return;
}
int h = value / 60;
int m = value % 60;
String text = "";
if (h < 10) {
text = "0";
}
text += h + " : ";
if (m < 10) {
text += "0";
}
text += m;
JSlider slider = (JSlider) e.getSource();
slider.setToolTipText(text);
}
};
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2-default
/**
* @return the length of the quantification interval as chosen by the user.
*/
private double getResolution(Extractor extractor) {
double selectedVal;
if (resolution != null)
selectedVal = (double) resolution.getValue();
else
selectedVal = 25.0;
double max = extractor.getMaximalValue();
double min = extractor.getMinimalValue();
double range = max - min;
double pot = 2.0 * (selectedVal / 100.0);
double perc = Math.pow(10.0, pot) - 1;
double result = (perc / 100.0) * range;
resolution.setToolTipText("Current: " + result);
return result;
}
代码示例来源:origin: net.sf.squirrel-sql.plugins/mssql
public void stateChanged(ChangeEvent e) {
JSlider slider = (JSlider) e.getSource();
if (slider.getValue() == 0) {
// don't bother changing the delay, but stop it if it's running.
if (_refreshTimer.isRunning())
_refreshTimer.stop();
}
else {
// change the delay, and start it if it was stopped.
_refreshTimer.setDelay(slider.getValue() * 1000);
if (!_refreshTimer.isRunning())
_refreshTimer.start();
}
// i18n[mssql.delay={0}s delay]
slider.setToolTipText(s_stringMgr.getString("mssql.delay", Integer.valueOf(slider.getValue())));
}
});
代码示例来源:origin: bcdev/beam
private JSlider createSpeedSlider() {
final JSlider speedSlider = new JSlider(1, 10);
speedSlider.setToolTipText("Choose the playing speed");
speedSlider.setSnapToTicks(true);
speedSlider.setPaintTrack(true);
speedSlider.setPaintTicks(true);
speedSlider.setPaintLabels(true);
speedSlider.setValue(6);
speedSlider.setPreferredSize(new Dimension(80, speedSlider.getPreferredSize().height));
speedSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
timerDelay = calculateTimerDelay();
timer.setDelay(timerDelay);
updateSpeedUnit();
}
});
return speedSlider;
}
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
resolution.setToolTipText("length of quantification interval.");
resolution.addChangeListener(this);
resolution.setMajorTickSpacing(25);
代码示例来源:origin: org.fudaa.framework.ebli/ebli-3d
void slideChanged() {
final int val = slIntensite_.getModel().getValue();
slIntensite_.setToolTipText(EbliResource.EBLI.getString("Intensit") + ": " + val);
// lbIntensite_.setText(Integer.toString(val));
if (!isUpdating_ && src_ != null) {
src_.setIntensite(val / MAX_SLIDER);
}
}
代码示例来源:origin: MegaMek/megamek
private JSlider buildSlider(String minMsgProperty, String maxMsgProperty, String toolTip, String title) {
JSlider thisSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 10, 5);
Hashtable<Integer, JLabel> sliderLabels = new Hashtable<Integer, JLabel>(3);
sliderLabels.put(0, buildSliderLabel("0 - " + minMsgProperty));
sliderLabels.put(10, buildSliderLabel("10 - " + maxMsgProperty));
sliderLabels.put(5, buildSliderLabel("5"));
thisSlider.setToolTipText(toolTip);
thisSlider.setLabelTable(sliderLabels);
thisSlider.setPaintLabels(true);
thisSlider.setMinorTickSpacing(1);
thisSlider.setMajorTickSpacing(2);
thisSlider.setSnapToTicks(true);
thisSlider.setBorder(new TitledBorder(new LineBorder(Color.black), title));
thisSlider.setEnabled(true);
return thisSlider;
}
代码示例来源:origin: org.jboss.jbossts/jbossjta
periodSelectSlider.setToolTipText(
"Select the number of (" + POLL_PERIOD + "ms) time slices over which to show the pie chart");
代码示例来源:origin: uk.co.caprica/vlcj
contrastSlider.setMaximum(Math.round(LibVlcConst.MAX_CONTRAST * 100.0f));
contrastSlider.setPreferredSize(new Dimension(100, 40));
contrastSlider.setToolTipText("Change Contrast");
contrastSlider.setEnabled(false);
contrastSlider.setPaintLabels(true);
brightnessSlider.setMaximum(Math.round(LibVlcConst.MAX_BRIGHTNESS * 100.0f));
brightnessSlider.setPreferredSize(new Dimension(100, 40));
brightnessSlider.setToolTipText("Change Brightness");
brightnessSlider.setEnabled(false);
hueSlider.setMaximum(Math.round(LibVlcConst.MAX_HUE * 100.0f));
hueSlider.setPreferredSize(new Dimension(100, 40));
hueSlider.setToolTipText("Change ");
hueSlider.setEnabled(false);
saturationSlider.setMaximum(Math.round(LibVlcConst.MAX_SATURATION * 100.0f));
saturationSlider.setPreferredSize(new Dimension(100, 40));
saturationSlider.setToolTipText("Change ");
saturationSlider.setEnabled(false);
gammaSlider.setMaximum(Math.round(LibVlcConst.MAX_GAMMA * 100.0f));
gammaSlider.setPreferredSize(new Dimension(100, 40));
gammaSlider.setToolTipText("Change ");
gammaSlider.setEnabled(false);
代码示例来源:origin: org.fudaa.framework.ebli/ebli-3d
slIntensite_.setToolTipText(EbliResource.EBLI.getString("Intensit"));
slIntensite_.setPaintLabels(true);
slIntensite_.setOrientation(SwingConstants.HORIZONTAL);
内容来源于网络,如有侵权,请联系作者删除!