I have a small application that updates the contents of a JFrame very quickly (many times per second) and on each update (I remove a component and then add a new one, then set visibility true again) the JFrame flashes on the Taskbar (WinXp) to request focus. It's very annoying and I'm sure it can be disabled. I just cant find out where.
...
What's the code to position a JFrame N pixels (say 300 pixels in x-direction) away from the center of the screen before one calls setVisible(true)?
...
Is it safe to call the dispose() method of a JFrame from a different thread (not the EDT)?
...
I have created a custom JPanel that displays images (lets call it MyPanel), I have added this to JFrame's contentPane.
I want JFrame to be resized automatically to fit the MyPanel when image changes.
It looks like I need to call frame.pack() to do this. Calling pack() from MyPanel increases coupling so I don't want to do that.
To solv...
Ok, I read the Java Documentation and I just can't figure out what is the main difference between those two methods. Sometimes I used setSize(), sometimes setPreferredSize(), sometimes one does what I want, sometimes the other.
So, what is the main difference between the two? Which one should I use for JFrames and JPanels?
Thanks
...
i've added a title to my Jframe, and now its blocked everything else, what have I done??
public class addressbook
{
public JFrame frame;
public JButton btnadd, btndelete, btnsave, btnprev, btnnext;
public JPanel panel, pTitle;
public JTextField txtname, txtaddress, txthomeno, txtmobno;
public JLabel JlbName , JlbHtn, JlbMtn, JlbAddress,...
I am working on learning java a little, and i found this question in a java text book on Google books, I have been working on it for a while, and for some reason these seems like it should be simple. Anyone bored and would like to show me what this is suppose to look like in Java code??
(Using ArrayList) Write a program that creates an ...
I'm using Vista, my old Java app ran on Win XP has thin borders, about 2 pixels thick, but now on Vista, the borders deafults to thick lines, maybe 6,7 pixels thick, can I specify in Java how thick my JFrame borders should be ?
...
I'm playing with things I don't really understand at the moment for a JAVA project on a Robot exploring an unknown territory (a grid of valid positions and blocked positions). Anyway, I tried to improve the basic GUI we were given as an example of how to proceed, it had been done with a text field and various unicode characters to repres...
I am trying to have a circle appear on the screen, then when the user clicks INSIDE the circle, enable the ability for them to drag the circle where the mouse goes while it is being pressed.
This is the code i have so far, the drag works, but it is allowing the user to drag without them pressing the inside of the circle, just when anywh...
I have set up a JFrame like this:
public class XFrame extends JFrame {
public XFrame() {
setSize(100, 100);
}
@Override
public void dispose() {
super.dispose();
System.out.println("Dispose get called");
}
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
...
Im trying to use the following code to eventually make a game. The code, as shown below, works.
import java.awt.event.*;
import javax.swing.*;
public class GUI extends JFrame implements ActionListener
{
public static void main(String[] args)
{
GUI g = new GUI();
}
public GUI()
{
try
{
UIManager.setLookAndFeel(UIManag...
My app works fine with Java 1.6 when I run it command line.
However, when I run it under the debugger in IntelliJ IDEA community edition 9, when it gets to the line
new JFrame();
the Vista reports the JVM fails with the message:
Java(TM) Platform SE binary has stopped working
A problem caused the program to stop working correctly....
I am interested in creating a work place consisting of multiple jframes. I would like to implement the functionality that google dashboard uses to dock their frames into a position. I would also like to be able to snap two frames together. Does anyone have any idea how google does this, how it might be done or perhaps code of an open sou...
Hi guys
I have a GUI window that I've created using Netbeans. I then ported the code into my own program so that I can display .png's at my will.
However, the GUI components are not displaying, and the window opens up with no size by default.
I need the window to initially open up with the GUI components visible, with the window of ...
Okay, I'm NOT a Java noob, it just so happens that I've forgotten a tad bit about core Java while I was learning more fun stuff like MySQL, Servlets, Java EE, JDBC etc etc; so don't frame your answers as if I were a beginner. Now the question.....
I'm writing a class (lets say ThisIsAJFrameExtendingClass) which extends JFrame, and to mi...
How would you write a method to detect if the mouse cursor is inside a JFrame in java? The method should return true if it is inside or else false.
Thanks, Andrew
...
I am trying to remove the drag bar across the top of the JFrame. I would like to keep the minimize maximize and close options that appear on this bar available. What I was thinking was to remove the bar (and icons). Then add the icons as embedded images, that implement the JFrame actionlistener. It would also be necessary for this to wor...
i have three JFrames, i want to close one of them without influence to another.
what can i do to get it ?
thanks Peter. I want to open two(or more) JFrames at the same time, and When I close one of them(use the default close button), others is still open.
...
I am making a brick game. I want the screen to get clear after every 0.1 second so that i can redraw every thing on the frame screen.
Is there any way to directly clear the frame screen without any event occurence??
...