|
|
Yeah, some good stuff on that site.
I must get a clever new signature for 2011.
|
|
|
|
|
simlpy throw the link at the OS - it should be able to handle that (open default browser and refer to that given link).
The example David posted is good, take a look at that one.
regards
Torsten
I never finish anyth...
|
|
|
|
|
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
|
|
|
|
|
well, you did close the window - and wanted it to react afterwards. This must result in an exception.
The IDE is never the problem - this is all native java code.
regards
Torsten
I never finish anyth...
|
|
|
|
|
Hello ,
I have dump file generated by java.exe We are using JDK\1.5.0_10\bin\java.exe
FULLDUMP_FirstChance_epr_Process_Shut_Down_java.ex e.dmp.
When I open this dump file I can see with following call stack:
ntdll!KiFastSystemCallRet
kernel32!ExitProcess+14
msvcrt!__crtExitProcess+32
msvcrt!_cinit+d2
msvcrt!exit+11
jvm!jmm_GetLastGCStat+e0d5
jvm!jmm_GetLastGCStat+f154
jvm!jmm_GetLastGCStat+106cc
jvm!AsyncGetCallTrace+1cf20
jvm!AsyncGetCallTrace+1cc7d
jvm!JVM_StartThread+186
jvm!JVM_RegisterPerfMethods+2d4bc
jvm!JVM_RegisterPerfMethods+2d48a
msvcrt!_endthreadex+a3
kernel32!GetModuleHandleA+df
I've searched the internet, but was not able to find anything that described this problem.
WinDbx shows some additional information:
FAULTING_IP:
+0
00000000 ?? ???
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 00000000
ExceptionCode: 80000003 (Break instruction exception)
ExceptionFlags: 00000000
NumberParameters: 0
FAULTING_THREAD: 00000cfc
DEFAULT_BUCKET_ID: WRONG_SYMBOLS
PROCESS_NAME: java.exe
MODULE_NAME: msvcrt
FAULTING_MODULE: 7c800000 ntdll
DEBUG_FLR_IMAGE_TIMESTAMP: 45d70b06
ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached.
PRIMARY_PROBLEM_CLASS: WRONG_SYMBOLS
BUGCHECK_STR: APPLICATION_FAULT_WRONG_SYMBOLS
LAST_CONTROL_TRANSFER: from 77e6690d to 7c82860c
STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
066ce844 77e6690d 00000001 77e8f3b0 ffffffff ntdll!KiFastSystemCallRet
066ce858 77bcade4 00000001 066ce894 77bcaefc kernel32!ExitProcess+0x14
066ce864 77bcaefc 00000001 00000001 6d8b1390 msvcrt!strerror+0x2b4a
066ce894 77bcaf52 00000001 00000000 00000000 msvcrt!initterm+0xf6
066ce8a8 6d80c21a 00000001 6d8535b5 00000001 msvcrt!exit+0x11
066ce90c 6d80d299 00000000 00000000 00000000 jvm!jmm_GetLastGCStat+0xe0d5
066ce97c 6d80e811 7c81a379 77bc6cd5 066ce9ac jvm!jmm_GetLastGCStat+0xf154
066cfdf8 6d7b744d 6d7b7451 066cff08 066cfe1c jvm!jmm_GetLastGCStat+0x106cc
066cfe48 6d7b71aa 066cff08 05e6cd9c 6d8b2104 jvm!AsyncGetCallTrace+0x1cf20
066cfec4 6d7d1de8 066cff08 05e6cd98 05e6cd9c jvm!AsyncGetCallTrace+0x1cc7d
066cff18 6d83fad4 05e6d580 05e6d580 05e6d580 jvm!JVM_StartThread+0x186
066cff44 6d83faa2 04d50280 6d80beed 00000000 jvm!JVM_RegisterPerfMethods+0x2d4bc
066cff84 77bcb530 05e6d580 00000000 00000000 jvm!JVM_RegisterPerfMethods+0x2d48a
066cffb8 77e6482f 04a50280 00000000 00000000 msvcrt!endthreadex+0xa3
066cffec 00000000 77bcb4bc 04a50280 00000000 kernel32!GetModuleHandleA+0xdf
STACK_COMMAND: ~0s; .ecxr ; kb
FOLLOWUP_IP:
msvcrt!strerror+2b4a
77bcade4 cc int 3
SYMBOL_STACK_INDEX: 2
SYMBOL_NAME: msvcrt!strerror+2b4a
FOLLOWUP_NAME: MachineOwner
IMAGE_NAME: msvcrt.dll
BUCKET_ID: WRONG_SYMBOLS
FAILURE_BUCKET_ID: WRONG_SYMBOLS_80000003_msvcrt.dll!base_address
Any ideas?
Regards,
Kiril
|
|
|
|
|
ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached.
PRIMARY_PROBLEM_CLASS: WRONG_SYMBOLS
BUGCHECK_STR: APPLICATION_FAULT_WRONG_SYMBOLS
Is this from a debugging-session? If not debug your code. and if it fails, give us a look on the code or so. The machine code output is worthless.
regards
Torsten
I never finish anyth...
|
|
|
|
|
hi, I'm doing a path-finding project as part of my 4th year software engineering degree.
we're suppose to give visual representation to a bunch of multi-agent pathfinding algorithm.
the simplest one is A* adapted for multiagents.
anyway our environment is a grid map where every cell can be either blocked or used as part of an agent's path.
what i wanna do is use animation to give a good representation of the final movement of the agent, but animating color change in my grid.
i.e paint every step in the path for a second or so with some color to show how the agent moves.
and the other thing i wanna do is to represent the way the algorithm works by painting the changes in the open list and closed list of the A* algorithm while its doing its calculation.
I'm using an adapted version of the observer design pattern to send events from my algorithm layer to my controller and gui layer.
what i wanna do in the gui layer is everytime a tile is added to the open list, i want to have that cell painted in some color and then have it fade away according to a predefined timer or maybe later add a slider to control this timer.
I looked at the code here: http://www.java2s.com/Code/Java/2D-Graphics-GUI/Colorfadinganimation.htm.
it seems pretty simple, the problem is that every tile animation has to be independent of the others to allow the algorithm and everything to keep running and different animations to start.
so whats the best way to achieve the results i'm looking for? should i just open a different thread for each animation or have a pre-made thread for each cell.
would that be an over kill for the application, since there can be up to 1000 cells and therfore close to 1000 threads performing animation.
another issue i think i might encounter is the fact that it might happen that a cell will start its color fading animation and then will have to restart and i don't want the two animations to go at the same time (only one thread performing animation for the same cell at the same time).
I hope i was clear enough with what i'm trying to achieve, if someone has any ideas or thought it could really help me with my project.
thanks in advanced
Amit Ofer
|
|
|
|
|
Hi All,
I have created a contentPane of 1600 x 1600. On this contentPane i am using JLabels attached to JPanels to show images. I have set the contentPane layoutmanager to null so i can place the JPanels where i want. E.g I want to place a JPanel off the screen so my player sprite can walk towards it and then the JPanel becomes visible as it enters the screen.
My probelm is that the JPanels are getting placed and showing on the initial screen but when my player sprite moves in a direction (lets say right) the JPanel also moves with the player sprite as the screen moves. How can i glue the JPanel to a fixed position? I have tried various layout managers but this also does not work.
Kurt
|
|
|
|
|
|
hi
(SORRY FOR MY BAD ENGLISH)
i am trying to make a GUI java .
it containes many textarea
but the number of textarea is defiend in the run time
how can i built a panel that uses scorll , what every the number of textarea i have the panel should not make an exception
thank you all
|
|
|
|
|
|
Dear sir,
I have collection of c++ classes,I want use them into my java application.
What is the best method to do this.
regards
sankar
|
|
|
|
|
|
Besides JNI you can also do the following.
1. Wrap your C++ code in a executable
2. provide a communications interface (such as sockets)
3. Run/manage the the executable via Runtime.exec() and communicate with it via the communications api.
The advantage to this over JNI is that it is easier to debug and the native code cannot crash the java VM.
|
|
|
|
|
I was involved in a commercial product that used this design model and it really was nothing but pain. In the end our management canned the whole thing because the outside company that did the bulk of the development could never get it to work properly.
I must get a clever new signature for 2011.
|
|
|
|
|
I worked with a senior developer that could not manage to produce a design document after three tries. On a very simple project. And before the third try I had basically outlined the document in detail to him.
|
|
|
|
|
Yes, there's no shortage of seniors like that in my experience.
I must get a clever new signature for 2011.
|
|
|
|
|
hi for all
(SORRY FOR MY BAD ENGLISH)first: i thank you all
i am always ask you and you always help me
really thank you
second:i want to make a program in java and after a one minute i want the program to pring anything
how can i use the time to make it
thank you all
|
|
|
|
|
Try Google and enter "Java Time" or "Java Elapsed Time" as your search keys. You will then find lots of references to classes and methods that can help you.
I must get a clever new signature for 2011.
|
|
|
|
|
Time flies like an arrow - fruit flies like banana
Time is measured in "ticks". Refer to the class Date[^] for further information. It is explained very well there.
regards
Torsten
I never finish anyth...
|
|
|
|
|
The Java Thread class[^] has a sleep() method which suspends the thread for the specified time span. That could be all you need (it really depends on your requirements, if the app has a GUI, you need either some timer or a separate Thread; if there is no GUI, no activity while waiting at all, then sleep suffices).
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
that's right,Thread. from china
|
|
|
|
|
Do you want to print the results repeatedly? If so read more about Threads.
Did you tryout anything yet?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
hi
(SORRY FOR MY BAD ENGLISH)
i thank you all
i have solved the problem
realy thank you all
now i have some new problems , i try to solve it
|
|
|
|