I have an application (Java, Windows) that when opened, shows a splash screen (Good, right?). I want to know how I could change it each time the application loads (or set it to load from a location outside the app cuz I could change that). I'm using netbeans if that helps. Also, this application gets installed to their program files directory. Ideally, I would like to be able to load from %AppData%. I can't seem to figure out this part though! Thanks!
UPDATE*
Here is my folder structure and some more info!
Related
I'm using JNativeHook to detect drags and clicks outside a JFrame in my program and it's running perfectly. The thing is I need a way (either using JNativeHook or anything else) to check if a folder is opened in my explorer (Finder for Mac) so that I can move a file to this opened folder. JNativeHook doesn't seem to have the option of detecting on what program or window was the click made.
I expect the output of the code I'm looking for to return the path of open folders in my system explorer so that I can move files to this path.
You will not be able to detect if explorer is opened to a particular folder. There are API's to detect things like the window under the cursor and get information like the title, however, if explorer is not displaying the path in the title, it will be very hard to detect without traversing the application components and finding the address bar of the window. See WindowFromPoint and GetWindowTextA for a staring point. It should work fine under JNA and can be combined with the coordinates returned from JNativeHook.
I am completely new to Andoid Studio, Java, and app development in general.
With that, in order to learn, I downloaded Android Studio version 2.3. And, for my first project, I imported the accelerometer example from the sensors library. I opened it, poked around, didn't change/save anything, and ran/installed the app on my phone (simply clicking the RUN button from the SDK), and it worked fine ... I see the metal balls rolling across my screen.
NEXT, I figured I would make a small change to the project and see what I have to do to rebuild/remake the app, since I see 'make project', 'make app', 'rebuild', 'build apk', and 'synchronize' ... still not sure what all those do exactly.
So, my simple change was in the app/res/layout/main.xml file, and all I changed was
from:
android:background="#drawable/wood"
to:
android:background="#drawable/ball"
After this change, I went through every possible make, build, clean sequence I could think of, including the synchronize options within the different files. I've even disabled the instant run feature, uninstalled the app from my phone, restarted my phone, and restarted Android SDK. I even found a checkbox to "skip installation if APK has not changed" in the RUN/DEBUG configuration window.
What am I missing? Every time I RUN APP, it's as if no changes were made ... I get the same "wood" background from the original main.xml file.
Here is a link to the repo: https://github.com/googlesamples/android-AccelerometerPlay/
I checked the code and if you take a look to the AccelerometerPlayActivity you can see that the background of the view that acts as the activity content (SimulationView) is being set on this piece of code (in the onCreate method):
// instantiate our simulation view and set it as the activity's content
mSimulationView = new SimulationView(this);
mSimulationView.setBackgroundResource(R.drawable.wood);
setContentView(mSimulationView);
So, that's where you have to make your changes.
I realise that there are other questions on this topic, all of which I have attempted to implement the answers of and failed. I would like to end up with a full blown answer, ideally with a demonstration, on how to, in Windows and only Windows set the desktop background instantly without having the user log in and out or lock and log back in. The approach that involves using the runtime console to push the registry entries about and then rundll32 user32.dll call UpdatePerUserSystemPreferences has yet to work for me. The desired behaviour is achieved when the user right clicks an image file in explorer and selects 'Set as desktop background'. I'd like to do that programatically even if it devolves to the level of opening a hidden explorer window and right-clicking a file in it as long as the user sees nothing of it. The application in question updates the user's desktop background image with useful system information. The image to be used will be generated and regenerated every five seconds.
Can I change my Windows desktop wallpaper programmatically in Java/Groovy?
So the correct way is with JNA if you are not familiar with JNA or if you haven't used JNA the link above is for you. Otherwise you are right about using natives but you never stated how you are using them so I am just taking shots in the dark here.
So as I tried to describe in the title.
I made an application that works 100% when compiled, and also when opened with the .jar file I made for it.
So my next step was to run this from my online portfolio. However, when I use the
<APPLET ARCHIVE="xxxxx.jar" CODE="xxxxx.class" WIDTH=400 HEIGHT=300>
</APPLET>
approach... So the Applet prompts me to run, I click Yes. My JFrame pops up like it normally would, however it is just a completely white blank screen. ( no content from my app )
I must have them linked appropriately if the JFrame even loads at all. So I'm not sure whats up.
Any help? Thanks
Edit: I forgot to mention, I am running this locally at the moment. Not sure if they would have anything to do with anything.
What method would I use to upload a .jar file to be executed from a web page?
For deploying Java desktop apps., the best option is usually to install the app. using Java Web Start. JWS works on Windows, OS X & *nix.
We had to write a Java application which runs on a windows 8 tablet (not RT).
I would much rather have written it using C#, but we really didn't have a choice.
Basically, we use launch4j to wrap our installer executable JAR in an EXE which then installs the appropriate application files and creates shortcuts on the desktop and in the start menu programs folder to ensure that the user sees the icons on the metro start screen.
The Problem
When the application starts up, it checks if any updates are available via a server, if they are available they are downloaded.
The issue that we've seen is that if the application is downloading the updates, and then we turn off the screen and leave it off for at least 30 seconds, once we turn the screen back on, the application is frozen and does not progress.
We then have to kill the app and start it again.
Providing the screen is not turned off again, the downloads finish and the application works fine.
Is there a way to either keep the screen on, keep our process running or detect when the screen comes back on and execute some code when that occurs?
Any help would be greatly appreciated.