jframe

How to avoid JFrame EXIT_ON_CLOSE operation to exit the entire application?

送分小仙女□ 提交于 2019-12-23 12:01:37
问题 I have a application that launches other applications, something like a dock. The problem is that if the app that I'm launching ( JFrame ) has the EXIT_ON_CLOSE it will also close my main application. I have no control what-so-ever over the applications that I'm launching. That is, I cannot expect the application to have a good behavior and use DISPOSE_ON_CLOSE . What can I do to avoid this? I've tried already to use threads, but no luck. I also tried to put the main application thread in

Making an Unfocusable Window in Java

旧时模样 提交于 2019-12-23 09:26:52
问题 (SOLVED: a WindowStateListener and a deferred call to toBack whenever the window is focused) Hello all! I've been trying to figure out how to make a java.awt.Window (any subclass will do) so that it cannot be brought to the front. I'm working on a Java "Samurize-like" program that appears below all the application windows and displays Widgets on the screen. Just like "Always on top windows with Java", I'm hoping for something simple, hopefully just a single method call, if possible, but I've

Unable to import javax.swing.JFrame

感情迁移 提交于 2019-12-23 08:37:17
问题 I've been looking all over the internet and Can't find an answer. I'm using Eclipse and need to import JFrame from javax.swing. But hovering over the the declaration (which in Eclipse should give you an option to import it) the import option does not show up. Instead I manually typed out the import path, but get an error. Going even further, I used the package explorer to attempt to fine it... couldn't. I have the latest version of Eclipse, and the Latest JRE and JDK. But still is not working

Two JFrames in one Runnable. First JFrame disappears in the application bar after calling a JFileChooser

心已入冬 提交于 2019-12-23 05:58:09
问题 I'm trying to create a multi-windowed interface, ala GIMP. One of them allows the user to load an image, to be displayed in the frame. So, when the program loads, all windows (two for now but I plan to have three) are shown in the application bar. However, when the second* window invokes JFileChooser, it disappears in the application bar ( but does not close ). But if I <Super>+<Tab> or <Alt>+<Tab> it still appears there. It also reappears in the app bar when I click the "Show/Hide All

Java MVC multiple JFrame

ⅰ亾dé卋堺 提交于 2019-12-23 05:26:18
问题 I am creating an mvc java application with netbeans . first, when running the program, it should be only show 2 buttons "Teacher" & "Student". when I click the teacher button , it will leads me to viewTeacher where i can input or edit data about "Teacher" . same goes for student button. I have finished the whole MVC but I am confused about the first buttons: - should I make more 1 view? viewForm, viewTeacher, viewStudent. viewForm is the first 2 buttons appear: "Teacher" & "Student" OR -

Swing circular JFrame

荒凉一梦 提交于 2019-12-23 04:52:32
问题 is it possible to make a circular JFrame without the need to the Class AWTUtilities i mean in jdk 6 .. is it possible?? 回答1: AWTUtilities can be used in all of JDK 6, and is standard as of update 10. I would refer you to the same link as before: http://java.sun.com/developer/technicalArticles/GUI/translucent_shaped_windows/ 回答2: No, it's not possible without AWT. 来源: https://stackoverflow.com/questions/5156912/swing-circular-jframe

Hilbert Curve in Applet with Matrix of coordinates

余生颓废 提交于 2019-12-23 04:28:25
问题 I am trying to approximate a solution of the Traveling Salesman Problem with a Hilbert Curve program. I have to do it by using an applet. How would I add the Matrix in my code, and how would I display the coordinates in the Applet. I don't need to have more than one frame. The code is below: import java.awt.*; import java.applet.*; // Background images (put a map in the back of the applet) public class HilbertCurve extends Applet{ private SimpleGraphics sg = null; private final int dist0=512;

Java 6, JFrame stuck alwaysontop

倖福魔咒の 提交于 2019-12-23 04:03:06
问题 This issue only seems to occur since I upgraded from 1.5 to 1.6 The main JFrame, randomly seems to get stuck infront of every other application in windows. Even another JDialog popping up set to alwaysontop(true) will be behind this main JFrame. Any ideas on what could be causing this issue? / Any ideas for solutions? Never had this issue before on Java 5. 回答1: Sorry guys it seems it was a program used as a screen splicer that was causing an issue with th Java program. Once the screen splicer

Java 6, JFrame stuck alwaysontop

做~自己de王妃 提交于 2019-12-23 04:02:32
问题 This issue only seems to occur since I upgraded from 1.5 to 1.6 The main JFrame, randomly seems to get stuck infront of every other application in windows. Even another JDialog popping up set to alwaysontop(true) will be behind this main JFrame. Any ideas on what could be causing this issue? / Any ideas for solutions? Never had this issue before on Java 5. 回答1: Sorry guys it seems it was a program used as a screen splicer that was causing an issue with th Java program. Once the screen splicer

getComponentAt() not finding a component?

江枫思渺然 提交于 2019-12-23 02:58:12
问题 I am using a JFrame to set up a game of Solitaire, using Cards that extend JLabel so that they can be dragged around the screen. However, one of my requirements is that I be able to double click a card and it snaps up to the 4 stacks of aces. This is not a problem. what is causing problems is that I set this up in an array, so that the aces would go to the spot that corresponds with the suit of the ace, then I have the spots rearrange if a card is dragged up there. If it is double clicked,