I'm having this issue in my MATLAB program.
I want to perform a set operation on my UI during a coding. In other words I'm pressing a button to launch my code and at the same time I want to change some uicontrols.
I tried with pause and wait with no luck.
I'm pretty sure that MATLAB gives priority to my coding part intead of the Java interface.
Anyone has any idea? Thanks
Thanks to nick I solved adding
waitnow; pause(.1);
Guys, unbelievable, that works on linux/OSX but not under windows..that's so weird
Related
I'm here to talk to you about a problem I got today working for the first time whit this new class called "Robot" of the library java.awt.
I must say Robot works fine, but troubles come every time i stop the application. My keyboard doesn't recognize any command and when i try to write something, random Windows appear everywhere,
as if the keyboard no longer recognizes the predefined keys. is there anyone who knows the reason for this strange behaviour and knows how to solve these issues?
thank you very much!
thankyou MadProgrammer, your observation was right! I solved my problem.
I'm sorry I didn't provide an example related to my question but I was sure that someone would nave understood my problem.
i would like to know if there is a possibility to generate an Infobubble in the taskbar like in the picture. So, if something is happening in my Java program then show the Infobubble.
Is this possible in Java?
Thanks for Answers!
ok, got it...link shows you how to add notification to system tray.
solved
Every time I run certain GUI interface excercises using swing the program works perfectly but something is wrong with what I suspect might be the jdk or something as it also happens like this on Eclypse.
It first appears to show correctly but with mouse over or when entering data in a textfield it all shows distorted.
Has anyone encountered these problems?
I managed to fix the problem re-installing the drivers to my graphics card!
Thank you.
Hope this helps anyone in the future with the same issue
I am simply trying to implement a button which will re run a main file in my program. So, essentially when the button is clicked, the application will restart, and it will be like the user is playing the game again from the start. Is this possible? and if so how would I go about coding this button? I am using netbeans IDE 8.0 Thank you all very much for taking the time to try and help me out :) I appreciate it. Kind regards.
Extra Edit 1: Is there anything that will just reopen the main class? I read somewhere that Application.Restart() will work in a C# application. Is there anything like this for NetBeans? Cheers in advance
for restarting application you can use below code
Runtime.getRuntime().exec("java -jar myApp.jar");
System.exit(0);
in netbeans platform application you can use this command
LifecycleManager.getDefault().markForRestart();
LifecycleManager.getDefault().exit();
Surely reading this will help:
http://docs.oracle.com/javase/tutorial/essential/concurrency/runthread.html
You should create a thread where the game is run.
Each time you pressed or reboot or wake up the thread.
I hope it's some help.
I'm currently working on a project for my studies. I'm trying to solve a simple puzzle game by using breadth first search. After I have found the optimal solution I want to simulate a series of keypresses (using awt.Robot) to solve the game.
Is there a way to bring a window with known title to the foreground. I'm using Linux and it would be okay to simply use some CLI tools since this is not the main focus of my project.
I found a tool called wmctrl which does excatly this. I simply start it using ProcessBuilder.
new ProcessBuilder("wmctrl", "-a", title).start()
To answer part of your question, see xprop or xwininfo to find the window.
For the second part, while Xlib provides a function to do this (XRaiseWindow()), I don't know how to do from the command line or inside Java. See this thread though.