本文整理了Java中javax.swing.Popup.show()
方法的一些代码示例,展示了Popup.show()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Popup.show()
方法的具体详情如下:
包路径:javax.swing.Popup
类名称:Popup
方法名:show
暂无
代码示例来源:origin: apache/geode
public void showPopupText(int x, int y, int xOnScreen, int yOnScreen) {
LifelineState state = getStateAt(x, y);
if (state == mouseoverState) {
return;
}
if (mouseover != null) {
mouseover.hide();
}
if (state == null) {
mouseover = null;
mouseoverState = null;
} else {
Component popupContents = state.getPopup();
mouseoverState = state;
mouseover =
PopupFactory.getSharedInstance().getPopup(this, popupContents, xOnScreen + 20, yOnScreen);
mouseover.show();
}
}
代码示例来源:origin: ron190/jsql-injection
/**
* Makes the {@code Popup} visible. If the popup has a
* heavy-weight container, we try to snapshot the background.
* If the {@code Popup} is currently visible, it remains visible.
*/
@Override
public void show() {
if (this.heavyWeightContainer != null) {
this.snapshot();
}
this.popup.show();
}
代码示例来源:origin: magefree/mage
@Override
public void mouseEntered(MouseEvent arg0) {
if (!tooltipShowing) {
if (tooltipPopup != null) {
tooltipPopup.hide();
}
PopupFactory factory = PopupFactory.getSharedInstance();
int x = (int) this.getLocationOnScreen().getX() + (permanent.isTapped()?Config.dimensions.frameHeight:Config.dimensions.frameWidth);
int y = (int) this.getLocationOnScreen().getY() + 40;
tooltipPopup = factory.getPopup(this, tooltipText, x, y);
tooltipPopup.show();
//hack to get tooltipPopup to resize to fit text
tooltipPopup.hide();
tooltipPopup = factory.getPopup(this, tooltipText, x, y);
tooltipPopup.show();
tooltipShowing = true;
}
}
代码示例来源:origin: magefree/mage
private void showTooltipPopup(final TransferData data, final Component parentComponent, final Point parentPoint) {
if (data.component != null) {
tooltipDelay = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_DELAY, 300);
if (tooltipDelay == 0) {
return;
}
}
if (cardInfoPane == null) {
PopupFactory factory = PopupFactory.getSharedInstance();
if (data.locationOnScreen == null) {
if (data.component == null) {
return;
}
data.locationOnScreen = data.component.getLocationOnScreen();
}
data.popupText.updateText();
tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40);
tooltipPopup.show();
// hack to get popup to resize to fit text
tooltipPopup.hide();
tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40);
tooltipPopup.show();
} else {
sumbitShowPopupTask(data, parentComponent, parentPoint);
}
}
代码示例来源:origin: magefree/mage
tooltipPopup.show();
tooltipPopup.show();
tooltipShowing = true;
代码示例来源:origin: stackoverflow.com
listbox.addChangeHandler() {
Popup popup = PopupFactory.createPopup(getSelectedItem());
popup.show();
....
}
代码示例来源:origin: stackoverflow.com
Popup popup = new Popup(getBaseContext());
popup.setOnDismissListener(new OnDismissListener(){
public void onDismiss(){
//do what you need to here
}
});
popup.show(arg1);
代码示例来源:origin: stackoverflow.com
Popup popup = new Popup(getBaseContext());
popup.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
// Do your action
}
});
popup.show(arg1);
代码示例来源:origin: com.fifesoft.rtext/fife.common
/**
* Makes the <code>Popup</code> visible. If the popup has a
* heavy-weight container, we try to snapshot the background.
* If the <code>Popup</code> is currently visible, it remains visible.
*/
@Override
public void show() {
if (heavyWeightContainer != null) {
snapshot();
}
popup.show();
}
代码示例来源:origin: com.github.insubstantial/substance
/**
* Makes the {@code Popup} visible. If the popup has a
* heavy-weight container, we try to snapshot the background.
* If the {@code Popup} is currently visible, it remains visible.
*/
@Override
public void show() {
if (heavyWeightContainer != null) {
snapshot();
}
popup.show();
}
代码示例来源:origin: stackoverflow.com
final Popup p = PopupFactory.getSharedInstance().getPopup(myComponent, new JLabel("Here is my popup!"), x, y);
p.show();
// create a timer to hide the popup later
Timer t = new Timer(5000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
p.hide();
}
});
t.setRepeats(false);
t.start();
代码示例来源:origin: org.java.net.substance/substance
/**
* Makes the <code>Popup</code> visible. If the popup has a heavy-weight
* container, we try to snapshot the background. If the <code>Popup</code>
* is currently visible, it remains visible.
*/
@Override
public void show() {
if (heavyWeightContainer != null) {
snapshot();
}
popup.show();
}
代码示例来源:origin: stackoverflow.com
public void actionPerformed(ActionEvent e) {
PopupFactory factory = PopupFactory.getSharedInstance();
final Popup popup = factory.getPopup(text1, new JLabel("POPUP"),frame.getX()+300,frame.getY()+300);
text1.addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (e.getID() == HierarchyEvent.HIERARCHY_CHANGED
&& (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
popup.hide();
}
}
});
popup.show();
}
代码示例来源:origin: stackoverflow.com
PopupFactory factory = PopupFactory.getSharedInstance();
JFrame frame = new JFrame();
frame.setLayout(null);
frame.setBounds(428, 99, 185, 155);
final JButton button = new JButton();
button.setText("Button");
button.setBounds(10, 93, 111, 25);
frame.getContentPane().add(button);
final Popup popup = factory.getPopup(null, frame, 200, 200);
popup.show();
代码示例来源:origin: chatty/chatty
private void showNow() {
if (popup != null) {
return;
}
label.setText(text);
Point p = determinePosition();
if (p != null) {
position = p;
popup = PopupFactory.getSharedInstance().getPopup(textPane, label, p.x, p.y);
popup.show();
}
}
代码示例来源:origin: stackoverflow.com
Popup popup = new Popup();
// add content (you can add as many nodes as you want)
popup.getContent().add(new Label("Hello Popup!"));
// show (move this to the double-click listener)
popup.show(primaryStage);
// hide (move this to the click listener)
popup.hide();
代码示例来源:origin: JDatePicker/JDatePicker
/**
* Called internally to popup the dates.
*/
private void showPopup() {
if (popup == null) {
PopupFactory fac = new PopupFactory();
Point xy = getLocationOnScreen();
datePanel.setVisible(true);
popup = fac.getPopup(this, datePanel, (int) xy.getX(), (int) (xy.getY() + this.getHeight()));
popup.show();
}
}
代码示例来源:origin: triplea-game/triplea
@Override
public void actionPerformed(final ActionEvent e) {
if (text.length() > 0) {
final Point currentPoint = MouseInfo.getPointerInfo().getLocation();
if (isPointWithinParentBounds(currentPoint)) {
final PopupFactory popupFactory = PopupFactory.getSharedInstance();
final JToolTip info = new JToolTip();
info.setTipText("<html>" + text + "</html>");
popup = popupFactory.getPopup(parent, info, currentPoint.x + 20, currentPoint.y - 20);
popup.show();
}
}
}
代码示例来源:origin: tulskiy/musique
private void showToolTip(MouseEvent e) {
Track s = player.getTrack();
if (s != null) {
toolTip.setTipText(Util.samplesToTime(progressSlider.getValue() - progressSlider.getMinimum(), s.getTrackData().getSampleRate(), 1));
int x = e.getXOnScreen();
x = Math.max(x, progressSlider.getLocationOnScreen().x);
x = Math.min(x, progressSlider.getLocationOnScreen().x + progressSlider.getWidth() - toolTip.getWidth());
popup = popupFactory.getPopup(progressSlider, toolTip, x, progressSlider.getLocationOnScreen().y + 25);
popup.show();
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
private void showPopup(Painter p, Rectangle rect) {
mouse.deinstall();
Point l = table.getLocationOnScreen();
rect.translate(l.x, l.y);
popupRect = rect;
PopupFactory popupFactory = PopupFactory.getSharedInstance();
popup = popupFactory.getPopup(table, p, l.x + p.getX(), l.y + p.getY());
popup.show();
paranoid = new Paranoid(p);
paranoid.install();
awt = new AWT();
awt.install();
}
内容来源于网络,如有侵权,请联系作者删除!