While trying to answer a applet question, the OP didn't know how to view error messages for his applet. It's been a while since I did this myself and I didn't find any step-by-step instructions for doing it, so I am posting a question and answer here for future generations.
Windows:
Double-click on the Java icon in the System tray next to the clock in the lower right corner. This will open the Java Control Panel.
Click on the Advanced tab.
Click on the + next to "Java Console" then click on "Show the Console".
The Java Console will display any stacktraces showing error messages from thrown Exceptions. You can also add System.out.println() calls to your applet code to print your own custom messages in the console.
Related
I have an applet code. That i added to one of my web-application, when i click tab called Enrollment, applet will load and java console will open. it is happening.
And when i click other tab this java console has close. and again if i click Enrollment tab again new Java console has open.
How to do it please help me regarding this.
How to close java console in mac when page get navigates to other page.?
The console disappearing is subject to decisions by the JVM. Typically it will be left on-screen as long as the JVM runs, and that is significantly later than when the user navigates away from the page.
The console can be configured (by the user or their system administrator) to not show at all. Anything beyond visible/not visible is not open to our control and you should not worry about, it is just wasting time.
I try to make an application which must be full screen. But when i press CTRL+ALT+DEL task manager comes up. Even i disable task manager, at this time its error message comes up and make taskbar visible. Then user get the chance to go to the dekstop but i dont want user to get this chance. Only user could be able to go to desktop when it did what application wants from it. So i need taskbar keep bottom of other windows until user does what it should do. And i need to do this by my application which i try to code in Java
How can i change the status of task bar using registry?
Why not permanently disable the taskbar?
Follow this link to permanently disable the task bar.
You can edit .reg files in Java, follow This link to know how to edit .reg files
"But how can i do it by java without reseting the machine?"
As far as i came across, you have to reboot your system, no way out.
Ok i found it.
When i changed the value of 8th byte value of Settings variable to 10 in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2
in registery
It just deselect the "Keep the task bar on top other windows" option
For applying the changes explorer.exe should be killed and re run
There are key strokes which Windows catches before they are sent to application and Ctrl+Alt+Del is one of those.
Regarding "Then user get the chance to go to the dekstop", if you set frame.setAlwaysOnTop(true);, user won't be able to switch to other any application.
You can use java's fullscreen API, and then use a Robot to force focus back to your application. See here: Java Full Screen Program (Swing) -Tab/ALT F4.
Good luck in whatever you are doing - it doesn't sound fun!
The application creates and displays various Swing widgets, and also writes debugging messages to System.out. If I start it as java -jar ...jar then I see it, but if I click on jar file in GUI I don't see the console. How to make it show console to user explicitly, e.g. on reaction to "View -> Debug output" menu item?
Expecting something that will pop up cmd.exe window on Windows, xterm/... on Linux, but it may be Swing window as well. How to do it the easily?
First don't use System.out to log, use some Logging framework to write logs in some file and to display the debugging logs open a new JDialog with JTextArea or JTextPane in it. Read the log file content and display that in the textArea. This way it will also solve platform dependency.
I think that you looking for CTRL + SHIFT + F1 works if is GUI visible here you can see output to the console, with Tree hierarchy of JComponents
AFAIK on Windows the console would be displayed on the first console output (i.e. System.out.printXXX), while on Linux it must be executed from console itself to do so. I'd rather create a separate window with a JTextArea (or something similar) to display the debug output. Normal users won't care about / need it, right?
I'm trying to debug a locally running java web start application. There is a call failing that I am trying to get a stack trace for, but it appears that nothing is ever getting printed out anywhere. The app just appears to be doing nothing.
Thanks!
Logging java console output
How do I pipe the Java console output to a file?
From the Control Panel in Windows you can start the Java control panel app. Then click on the "Advanced" tab, select "Java Console" and the select "Show Console". The stack trace will now appear in the console. I believe the console allows you to save the file to disk if you want.
OK, maybe I'm dumb/blind, but in the docs it says "rebuild and restart the server." But I don't see a button to do this anywhere. Or from any contextual menu. And I can't find anything in their docs explaining how to do it. If I just try to start the app again, it gets angry because I already have App Engine running on the needed port.
Only solution I've found is to restart Eclipse... any other ideas? A screenshot of a button would help if possible. :)
In eclipse, there is a view that contains your Console. If you click on that, you will see the STDOUT and STDERR output of your running application. In the upper right, there should be a red box that will terminate the currently running program.
I have a different and possibly more productive solution for you. Like with most web development environments you probably want to change your source code and have Google Appengine server reload the new code for you.
You need some version of the traditional "touch" unix command (if you work on windows you can download a version from here).
Then go to you project properties, Builders and add a new build step as a "Program". Under "Location" enter the path to your "touch" command ("D:\bin\UnxUtils\usr\local\wbin\touch.exe" for example - on Posix systems just "touch" should be enough since it's already in your PATH) and in "Arguments" put something like "${project_loc}/war/WEB-INF/appengine-web.xml".
Also go to the "Build Options" tab and check "During auto builds".
"touch" will update the timestamp in you appengine-web.xml. When the App Engine server detects changes to you appengine-web.xml it will reload the app automatically. The load process is very fast so it can be done whenever you change any file in your project (which normally triggers the auto-build in Eclipse) - you can tweak the builder to only run when you change certain types of files.
I might add that the "little red box" is not always visible. It drove me crazy reading that same instruction but not seeing the terminate button until I discovered that the Console windows has "layers" that you can select from using the drop-down button on the far right of the controls for the Console view. You just need to go "back" to the console screen that says the server is running and you will see the little red terminate button.
The previous answer wasn't cutting the cheese for me. Upon first starting App Engine, the red square would be available above the text entry area. If I then clicked the run button again, then red square would go away and the console for the previous launch would be replaced by the console for the new launch. To manually stop the App Engine server, you can kill it from the terminal:
http://geekbrigade.wordpress.com/2009/02/26/how-to-find-and-kill-a-process-that-is-using-a-particular-port-in-ubuntu/
In short, "sudo netstat -lpn |grep :8888" and kill the service by process ID.
Strangely, adding Google Web Toolkit to the project made my App Engine launch show up in the Development Mode pane, where it could be easily be killed or restarted.
Just Click on Debug perspective (should be on upper right panel), select the instance of web application on Debug panel (if you don't show it, you could enable by menu Window->show view->Debug) and click on red box of view menu.
The best I've found is to setup the keyboard shortcuts for the console's terminate button, and the run/debug start/restart command. By default, you can enable Command-F2 to terminate, and Command-F11 to restart, its fairly painless. Make sure to enable the full debug menu group (click on main toolbar -> customize, etc)
If you include the gwt SDK in your project, the gwt development mode box contains a reload server button that will work just fine.