问题标签 [jwindow]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1759 浏览

java - 将 Keylistener 添加到全屏 JWindow

我制作了一个全屏 JWindow,我想添加一个简单的 KeyListener,以便在按下箭头键的情况下执行某些操作
但我不知道为什么它不起作用。我已将 keylistener 添加到所有组件中。但它不起作用
谁知道问题出在哪里?

0 投票
1 回答
600 浏览

java - 真的不可能在运行时删除任何 JDialog 或 JWindow

正如我所尝试的那样,看起来这是不可能的,我尝试过的没有成功,还是以另一种方式存在?

0 投票
1 回答
303 浏览

wpf - WPF 中类似 Java 的窗口导航

我是一名 Java 开发人员,为了用户交互,我创建了一个通用的JFrame并在其中包含一个JPanel容器,然后我将该容器与我创建的其他面板交换。

我开始开发 WPF 应用程序,但我找不到如何做到这一点。我发现所有这些PageUserControl但我无法理解其中的区别以及如何完成我的任务。我找不到好的教程,也无法理解如何在 Google 中搜索。

任何好的信息或教程将不胜感激。

0 投票
1 回答
2608 浏览

java - JWindow上的JPanel,添加组件

我有一个JFrame, 在JFrame我创建的代码中,我JWindow在窗口上创建了一个JPanel. OnJPanel插入背景图像。

我是新手JWindow,有以下问题:

  1. 如何在JWindow(或JPanelJWindow)上添加按钮和标签等元素?
  2. 如何将 my 设置JFrame为 this 的父级JWindow?我的意思是当JWindow它处于活动状态时,它JFrame不应该是可点击的。

所需最终效果的示例

飞溅示例

0 投票
2 回答
372 浏览

java - 小程序不可见时隐藏JWindow?

我在我的小程序中创建了一个 JWindow 来显示更新过程,并将所有者设置为小程序父级。我的问题是 JWindow 在我浏览器的所有选项卡中都可见,而不仅仅是包含我的小程序的选项卡。是否可以添加一个监听器来知道我的小程序何时可见?(然后隐藏 JWindow 不是)

0 投票
2 回答
1042 浏览

java - Netbean:如何将 UI 窗口大小调整为屏幕大小

我正在使用 Netbeans 在 Java 中开发一个小型应用程序。我使用 JFrame 作为基本控件,并根据需要将所有必需的控件拖放到它上面。

该应用程序按预期工作正常。现在我只是希望当我的应用程序第一次运行时,我的应用程序窗口的大小应该等于我的屏幕大小。简而言之,我希望我的应用程序在打开时最大化。以下是我的主要方法的代码:

0 投票
1 回答
1921 浏览

java - Java Swing:JWindow出现在所有其他进程窗口之后,并且不会消失

我正在使用 JWindow 在应用程序启动期间显示我的启动画面。但是它不会出现在所有窗口的前面,它也不会消失。

因此,在我扩展 JFrame 的主类中,我将启动画面称为

但是,JWindow 出现在我计算机上所有打开的窗口实例的后面。隐藏 JWindow 也不起作用。

0 投票
1 回答
420 浏览

java - 如何在Java中申请JWindow setAlwaysOnTop?其他 JWindows 也已应用于 setAlwaysOnTop

我有 3 个分层窗口(如 Gimp 软件)。由于某些显示原因,我的所有 JWindow 都被分配给 setAlwaysOnTop (xrandr --output VGA --left-of LVDS)。

但我需要这三个中的一个成为“超级主力始终处于领先地位,无论它移动或受到拖累,它始终保持超级领先”。我怎样才能设置那个?

Toolbox.java << 对于任何拖拽等,他都应该是最棒的

Layers.java < 正常

Drawing.java < 正常

当我启动绘图窗口时,我所有的工具箱和图层窗口都会落后。但我希望工具箱窗口永远保持在最前面,除非我关闭它。怎么做?

0 投票
2 回答
3121 浏览

java - Using JWindow for a floating tool window causes the owner window to "flicker" when clicking into the floating window

Background Information

I would like to build a tool/palette window (also called a "floating" window) in Swing with Java Version 1.6.0_26. I thought a JWindow is the best pick, and also the Swing documentation points out to use a JWindow for such purposes (floating window, which has an owner frame, has no decoration and no windows taskbar entry).

My floating tool window's content consists of several other components like JButtons and also JTextFields.

The problem

When I click into the floating tool window, the owner window (the JFrame, my "main application window") "flickers" occasionally. The "flicker" looks like the owner window is losing the focus for a few milliseconds and than gets the focus back, resulting in a very fast disabling/enabling of the window (note that no window event is fired, like focus-lost or window-deactivated).

I have tested this under Windows 7 64 Bit and Windows XP.

Video and example code

To clarify the problem (it is a bit difficult to explain), I've taken a video, there you can see the "flicker" of the owner window while I click onto the floating tool window repeatedly:

I also put together a simple example code to reproduce the problem (this code is used in the video):

Progress so far

I also tried to set "Window.setFocusableWindowState" to false for the floating tool window. If it is false, there is no "flicker", the problem is gone. The JavaDoc for that method points out:

Setting a Window's focusability state to false is the standard mechanism for an application to identify to the AWT a Window which will be used as a floating palette or toolbar, and thus should be a non-focusable Window."

But then I can't use a JTextField in the floating tool window of course, because I can't focus it (maybe a text field in a floating tool window is unusual, but in my case a must).

I guess the "flicker" effect has something to do with the focus management in some way... for the fraction of a second the floating tool window gets the focus, taking it away from the owner window and then back. But I'm not sure; as a side note: if the text field in the floating tool window has the focus, the owner window stays enabled (which is a correct behavior).

I hope there is an easy solution, one so that I can stay with the JWindow as my floating tool window and with text fields as it's content - because, apart from the described "flicker" problem, everything works great.

I really appreciate any help, thanks a lot!

0 投票
3 回答
3780 浏览

java - 使 Java 应用程序对用户不可见

我试图找出一种方法使 Java 应用程序对用户不可见。

基本上只是试图删除这个

任务栏图标<- 图片

如何才能做到这一点?