本文整理了Java中javax.swing.JFrame.isVisible()
方法的一些代码示例,展示了JFrame.isVisible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.isVisible()
方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:isVisible
暂无
代码示例来源:origin: igniterealtime/Smack
public boolean isVisible() {
return frame != null && frame.isVisible();
}
代码示例来源:origin: log4j/log4j
/**
* Show the frame for the LogBrokerMonitor. Dispatched to the
* swing thread.
*/
public void show(final int delay) {
if (_logMonitorFrame.isVisible()) {
return;
}
// This request is very low priority, let other threads execute first.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Thread.yield();
pause(delay);
_logMonitorFrame.setVisible(true);
}
});
}
代码示例来源:origin: igniterealtime/Openfire
private void toggleVisibility(MenuItem showMenuItem) {
// Hide/Unhide the window if the user clicked in the system tray icon or
// selected the menu option
if (frame.isVisible()) {
frame.setVisible(false);
showMenuItem.setLabel("Show");
} else {
frame.setVisible(true);
frame.setState(Frame.NORMAL);
showMenuItem.setLabel("Hide");
}
}
代码示例来源:origin: stackoverflow.com
public void run() {
synchronized(lock) {
while (frame.isVisible())
try {
lock.wait();
代码示例来源:origin: RipMeApp/ripme
private void toggleTrayClick() {
if (mainFrame.getExtendedState() == JFrame.ICONIFIED
|| !mainFrame.isActive()
|| !mainFrame.isVisible()) {
mainFrame.setVisible(true);
mainFrame.setAlwaysOnTop(true);
mainFrame.setAlwaysOnTop(false);
trayMenuMain.setLabel("Hide");
} else {
mainFrame.setVisible(false);
trayMenuMain.setLabel("Show");
}
}
代码示例来源:origin: RipMeApp/ripme
Thread t = new Thread(ripper);
if (configShowPopup.isSelected() &&
(!mainFrame.isVisible() || !mainFrame.isActive())) {
mainFrame.toFront();
mainFrame.setAlwaysOnTop(true);
代码示例来源:origin: RaiMan/SikuliX2
public boolean isVisible() {
return frame.isVisible();
}
代码示例来源:origin: i2p/i2p.i2p
private void handle(MouseEvent e) {
//System.out.println("Button " + e.getButton() + " Frame was visible? " +
// frame.isVisible() + " menu was visible? " + menu.isVisible() +
// " trigger? " + menu.isPopupTrigger(e));
// http://stackoverflow.com/questions/17258250/changing-the-laf-of-a-popupmenu-for-a-trayicon-in-java
// menu visible check is never true
if (!frame.isVisible() /* || !menu.isVisible() */ ) {
frame.setLocation(e.getX(), e.getY());
frame.setVisible(true);
menu.show(frame, 0, 0);
}
updateMenu();
}
});
代码示例来源:origin: stackoverflow.com
final JFrame f = new JFrame();
f.setContentPane(contentPane);
f.setSize(800, 600);
// f.pack();
JFrame controller = new JFrame("opener");
controller.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Action open = new AbstractAction("open/hide second") {
@Override
public void actionPerformed(ActionEvent e) {
f.setVisible(!f.isVisible());
}
};
controller.add(new JButton(open));
controller.pack();
controller.setVisible(true);
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library
public boolean isVisible() {
if (frame != null) {
return frame.isVisible();
}
return false;
}
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
public void insertUpdate(DocumentEvent de)
{
if (maFenetre.isVisible())
return;
maFenetre.setVisible(true);
}
代码示例来源:origin: beryx/text-io
public void display() {
if(!initialized) {
initialized = true;
frame.pack();
}
if(!frame.isVisible()) {
frame.setVisible(true);
}
}
代码示例来源:origin: stackoverflow.com
// Create the dialog/frame which contains the JSplitPane
final JFrame frame = new JFrame("JSplitPane Problem");
frame.setCloseOperation(JFrame.HIDE_ON_CLOSE);
// ...
myButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
if (!frame.isVisible())
frame.setVisible(true);
}
});
代码示例来源:origin: stackoverflow.com
JFrame frame = null;
public void actionPerformed(ActionEvent e) {
if ( frame == null ) {
frame = new NewTask();
frame.pack();
}
frame.setVisible( !frame.isVisible() );
}
代码示例来源:origin: CFPAOrg/I18nUpdateMod
private void onDownloadFinish() {
if (!frame.isVisible()) {
if (manager.getStatus() == DownloadStatus.SUCCESS) {
DownloadInfoHelper.info.add("资源包后台下载完成,下次重启游戏将加载资源包");
} else {
DownloadInfoHelper.info.add("资源包后台下载失败");
}
}
}
}
代码示例来源:origin: robo-code/robocode
public void showRobocodeEditor() {
JFrame editor = (JFrame) net.sf.robocode.core.Container.getComponent(IRobocodeEditor.class);
if (!editor.isVisible()) {
WindowUtil.packCenterShow(editor);
} else {
editor.setVisible(true);
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public void onNewMessage(sensor_msgs.CompressedImage message)
{
if (cameraFrame.isVisible())
{
cameraImage = RosTools.bufferedImageFromRosMessageJpeg(colorModel, message);
cameraPanel.getGraphics().drawImage(cameraImage.getScaledInstance(cameraImage.getWidth(), cameraImage.getHeight(), 0), 0, 0, null);
}
}
代码示例来源:origin: sc.fiji/TrakEM2_
Utils.invokeLater(new Runnable() { public void run() {
if (null != IJ.getInstance()) IJ.getInstance().setCursor(c);
ini.trakem2.display.Display.setCursorToAll(c);
if (null != frame && frame.isVisible()) frame.setCursor(c); // the ControlWindow frame
}});
}
代码示例来源:origin: triplea-game/triplea
public MoveDescription getMove(final PlayerId player, final IPlayerBridge bridge, final boolean nonCombat,
final String stepName) {
messageAndDialogThreadPool.waitForAll();
actionButtons.changeToMove(player, nonCombat, stepName);
// workaround for panel not receiving focus at beginning of n/c move phase
if (!getBattlePanel().getBattleFrame().isVisible()) {
requestWindowFocus();
}
return actionButtons.waitForMove(bridge);
}
代码示例来源:origin: uk.co.caprica/vlcj
private void syncVideoSurface() {
if (frame.isVisible()) {
// We re-size and re-position to the reference panel contained within the frame rather than the frame
// itself, this makes it easy to add other UI elements without worrying about calculating the correct size
// and position for the video surface ourselves - the referencePanel is in effect a "proxy" for the video
// surface
referencePanel.getBounds(bounds);
bounds.setLocation(referencePanel.getLocationOnScreen());
window.setBounds(bounds);
}
}
内容来源于网络,如有侵权,请联系作者删除!