Click here to Skip to main content
15,897,518 members
Home / Discussions / Java
   

Java

 
AnswerRe: how to record a video in java? Pin
Adrabi Abderrahim12-Apr-11 11:39
Adrabi Abderrahim12-Apr-11 11:39 
AnswerRe: how to record a video in java? Pin
csanuragjain16-Apr-11 21:59
csanuragjain16-Apr-11 21:59 
Questionhow to open a website when i press a button in Java Pin
williamroma26-Mar-11 14:22
williamroma26-Mar-11 14:22 
AnswerRe: how to open a website when i press a button in Java Pin
Richard MacCutchan26-Mar-11 21:53
mveRichard MacCutchan26-Mar-11 21:53 
AnswerRe: how to open a website when i press a button in Java Pin
DaveAuld26-Mar-11 22:41
professionalDaveAuld26-Mar-11 22:41 
GeneralRe: how to open a website when i press a button in Java Pin
Richard MacCutchan27-Mar-11 0:52
mveRichard MacCutchan27-Mar-11 0:52 
AnswerRe: how to open a website when i press a button in Java Pin
TorstenH.28-Mar-11 1:19
TorstenH.28-Mar-11 1:19 
QuestionSwing JDialog bug? [modified] Pin
amit ofer26-Mar-11 1:03
amit ofer26-Mar-11 1:03 
hi, I'm trying to create my own dialog by extending the JDialog class
this is the code i used to start:

import javax.swing.JDialog;

public class ColorManager extends JDialog{
	
	private static final long serialVersionUID = 1L;
	public ColorManager(){
        super();
	this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        this.pack();
        this.setVisible(true);
		
	}
}


when i try to run the code it works fine but i'm getting the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE

i read that there were problems with WINDOWS_EXIT or something like that but the parameter i pass should do the job.
the thing that makes it even weirder is that when i change my class so it will contain a JDialog field instead of extending it, it seems to work just fine.
I asked a friend to test this on his computer and the code did not throw the exception, he is using jre version 1.6.022 and I'm using 1.6.022 both of us are using 64 bit.

so what did i do wrong? or is that a bug in the JRE?

thank,

Amit ofer

Edit: forgot to mention, I'm using eclipse
Edit2: i tried the same code in Netbeans and it works fine, what could be my problem??

modified on Saturday, March 26, 2011 7:12 AM

AnswerRe: Swing JDialog bug? Pin
TorstenH.28-Mar-11 1:25
TorstenH.28-Mar-11 1:25 
QuestionCrash in java.exe Pin
schki0225-Mar-11 13:31
schki0225-Mar-11 13:31 
AnswerRe: Crash in java.exe Pin
TorstenH.28-Mar-11 1:16
TorstenH.28-Mar-11 1:16 
Questioncolor fade animation for grid cells in swing Pin
amit ofer25-Mar-11 5:30
amit ofer25-Mar-11 5:30 
QuestionGluing JLabels to a contentPane Pin
kurt124-Mar-11 12:30
kurt124-Mar-11 12:30 
AnswerRe: Gluing JLabels to a contentPane Pin
JP_Rocks27-Mar-11 1:07
JP_Rocks27-Mar-11 1:07 
Questionusing scroll in java GUI Pin
williamroma23-Mar-11 2:23
williamroma23-Mar-11 2:23 
AnswerRe: using scroll in java GUI Pin
TorstenH.23-Mar-11 3:46
TorstenH.23-Mar-11 3:46 
QuestionHow can we call c++ functions by using java code Pin
sankardunga21-Mar-11 1:09
sankardunga21-Mar-11 1:09 
AnswerRe: How can we call c++ functions by using java code Pin
Richard MacCutchan21-Mar-11 2:59
mveRichard MacCutchan21-Mar-11 2:59 
AnswerRe: How can we call c++ functions by using java code Pin
jschell21-Mar-11 7:52
jschell21-Mar-11 7:52 
GeneralRe: How can we call c++ functions by using java code Pin
Richard MacCutchan21-Mar-11 8:51
mveRichard MacCutchan21-Mar-11 8:51 
GeneralRe: How can we call c++ functions by using java code Pin
jschell22-Mar-11 8:04
jschell22-Mar-11 8:04 
GeneralRe: How can we call c++ functions by using java code Pin
Richard MacCutchan22-Mar-11 8:21
mveRichard MacCutchan22-Mar-11 8:21 
QuestionTIME in java Pin
williamroma20-Mar-11 0:38
williamroma20-Mar-11 0:38 
AnswerRe: TIME in java Pin
Richard MacCutchan20-Mar-11 5:04
mveRichard MacCutchan20-Mar-11 5:04 
AnswerRe: TIME in java Pin
TorstenH.20-Mar-11 7:39
TorstenH.20-Mar-11 7:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.