Results 1 to 10 of 10
Like Tree4Likes
  • 1 Post By JosAH
  • 2 Post By SnakeDoc
  • 1 Post By SnakeDoc

Thread: Is it possible to code a Swing application and run in on a Windows Tablet?

  1. #1
    rhexis is offline Member
    Join Date
    Nov 2011
    Posts
    56
    Rep Power
    0

    Default Is it possible to code a Swing application and run in on a Windows Tablet?

    I'm in the midst of developing an application for my Final Year Project and I would like to know if one can code purely in Java, export it as .jar or which ever format and have it run on a Windows OS Tablet.

    Thank you for your help! :)

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Just give it a try and see; if there is a JVM available for that processor it probably works ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    rhexis is offline Member
    Join Date
    Nov 2011
    Posts
    56
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Quote Originally Posted by JosAH View Post
    Just give it a try and see; if there is a JVM available for that processor it probably works ...

    kind regards,

    Jos
    Thanks for the reply. The problem is I do not own any Windows OS Tablet, and I there's no way I can afford one. The only thing I can do is to find a Tablet that does support Swing Java and say that the application will be implemented on to one.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    A bit of googling resulted in this: How to install Java on Windows 8 Pro | Microsoft Surface tablet
    I bet it's only for the Intel tablets (not the ARM based tablets), but who knows ...

    kind regards,

    Jos
    rhexis likes this.
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    SnakeDoc is offline Senior Member
    Join Date
    Apr 2012
    Posts
    129
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    The ARM java version will run on the RT tablets. It's similar to running java on the Raspberry Pi's which are ARM v6's. OpenJDK and Oracle's offering should get you through... however your challenge will be to get end users to install the JVM... and on a tablet, this might be more of an issue since users are trained to get apps and software from the Market built into the device... not from the web anymore.

    For testing purposes on ARM devices, you can pick yourself up a Raspberri Pi, they are pretty cheap and will give you an ARM device to develop on.

    Also note, Android devices (tablets and phones) can run your Java code so long as you do not use any of the libraries Google has removed/excluded from the Android SDK (such as all the AWT and SWING libraries, JOptionPane, JEditorPane, etc). So you could have core logic in Java and then extend it with the "android java"... just some thoughts... I have not done that myself, but I"m told by other devs it can be done.

    Good luck!

    Here's the Java Embedded (for ARM) links: Java Embedded: Java SE download

    Here's more info about Java Embedded: https://blogs.oracle.com/henrik/entr..._jdk_for_linux
    Last edited by SnakeDoc; 03-26-2013 at 08:29 PM.
    DarrylBurke and rhexis like this.

  6. #6
    rhexis is offline Member
    Join Date
    Nov 2011
    Posts
    56
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Quote Originally Posted by SnakeDoc View Post
    The ARM java version will run on the RT tablets. It's similar to running java on the Raspberry Pi's which are ARM v6's. OpenJDK and Oracle's offering should get you through... however your challenge will be to get end users to install the JVM... and on a tablet, this might be more of an issue since users are trained to get apps and software from the Market built into the device... not from the web anymore.

    For testing purposes on ARM devices, you can pick yourself up a Raspberri Pi, they are pretty cheap and will give you an ARM device to develop on.

    Also note, Android devices (tablets and phones) can run your Java code so long as you do not use any of the libraries Google has removed/excluded from the Android SDK (such as all the AWT and SWING libraries, JOptionPane, JEditorPane, etc). So you could have core logic in Java and then extend it with the "android java"... just some thoughts... I have not done that myself, but I"m told by other devs it can be done.

    Good luck!

    Here's the Java Embedded (for ARM) links: Java Embedded: Java SE download

    Here's more info about Java Embedded: https://blogs.oracle.com/henrik/entr..._jdk_for_linux
    Hello.

    I have been busy with my codes so I haven't been able to check back. Sorry for the late reply and thank you for both of your replies.

    To JosAH, I have read up about the Windows Surface Pro. I did google and find that site, but I didn't quite understand what it meant as it was talking about Desktop. Until further reading did I realize that Windows Surface Pro was a tablet that can act as a "netbook", I guess. So Java can be installed on a Windows Surface Pro, thank you for your help! :)

    As for SnakeDoc, I'm sorry, but you really really lost me in your post. I'm actually not so concerned about getting users to install JVM, because basically I'm developing a private application for a organization, so their tablets would have to have the JVM installed in order to run this application. You really lost me at the Raspberry Pi portion. I did some googling and Raspberri Pi is like a processor, am I right?

    And yes, I do know that Android allows for Java coding, excluding the Swing. I did install the plugin for Eclipse, and tried to "develop" the application using it but it was rather confusing because I am not well versed in the codes, and due to time constraint I am not able to learn it yet.

    I hope you would reply to me a few more times, SnakeDoc, because your post is very detailed and I hope to learn a little more about what you mean. Thank you.

    EDIT: After reading through your post again, do you mean I can get a tablet, install a RaspBerry Pi ARAM and test the application?

  7. #7
    SnakeDoc is offline Senior Member
    Join Date
    Apr 2012
    Posts
    129
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Hello rhexis!

    No worries on the delayed response, we always encourage and am glad to see posters research their own questions and show initiative!

    As far as my original post goes, if you will be working within a controlled environment (as in, you know a JVM will always be installed on a device that will run your app ahead of time), then this can be a safe assumption and you don't have to worry about it. I was answering your question from the angle of releasing general purpose software to the world and you the creator hoping regular users would install the JVM and then use your software. If you are releasing to your organization like you mentioned, and the JVM will always be present already, then disregard this.

    As far as the Raspberri Pi goes, it is not a processor, it is a full linux computer (albeit a very small one, about the size of a credit card and is super cheap, about $25-$35 depending on the model you get). I was suggesting you pick up a Raspberri Pi because it's processor (SoC - System on Chip) is an ARM v6 cpu, meaning anything you develop on the Raspberri Pi will run on any other ARM devices (such as the Win RT tablet, etc). The Raspberry Pi just so happens to be an ARM device that is really cheap, making it a great platform to develop on for ARM software. Of course if you already have an ARM device such as another tablet, or some other setup, then you won't need a Raspberri Pi, but if you do not have an ARM development system already, it may be a great cheap option. I was simply suggesting that if you do not have an ARM device to develop on, and getting a tablet may be out of the price-range/budget, then you should check into the Raspberri Pi because of how cheap it is.

    The Windows Surface RT uses an ARM cpu at it's core, meaning it cannot run or execute traditional x86 platform code (code compiled for the x86 architecture). Instead it can only run software compiled for the ARM architecture or architecture independent software (such as javascript/html5). The Windows Surface Pro uses a traditional x86 architecture cpu at it's core, meaning it can run any traditional software without recompile. Since you are writing your software for the first time, you will need to decide what your target devices are. I think for simplicity, you will want to compile your java code on an ARM device for ARM devices since the Java Embeded JDK may or may-not have special libraries are libraries that are excluded, although I may be wrong here and compiling java code on any system might work just fine for an ARM cpu target.

    Hope that lifts some of the fog... if not, post back and we can continue the discussion. :)

  8. #8
    rhexis is offline Member
    Join Date
    Nov 2011
    Posts
    56
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Quote Originally Posted by SnakeDoc View Post
    Hello rhexis!

    No worries on the delayed response, we always encourage and am glad to see posters research their own questions and show initiative!

    As far as my original post goes, if you will be working within a controlled environment (as in, you know a JVM will always be installed on a device that will run your app ahead of time), then this can be a safe assumption and you don't have to worry about it. I was answering your question from the angle of releasing general purpose software to the world and you the creator hoping regular users would install the JVM and then use your software. If you are releasing to your organization like you mentioned, and the JVM will always be present already, then disregard this.

    As far as the Raspberri Pi goes, it is not a processor, it is a full linux computer (albeit a very small one, about the size of a credit card and is super cheap, about $25-$35 depending on the model you get). I was suggesting you pick up a Raspberri Pi because it's processor (SoC - System on Chip) is an ARM v6 cpu, meaning anything you develop on the Raspberri Pi will run on any other ARM devices (such as the Win RT tablet, etc). The Raspberry Pi just so happens to be an ARM device that is really cheap, making it a great platform to develop on for ARM software. Of course if you already have an ARM device such as another tablet, or some other setup, then you won't need a Raspberri Pi, but if you do not have an ARM development system already, it may be a great cheap option. I was simply suggesting that if you do not have an ARM device to develop on, and getting a tablet may be out of the price-range/budget, then you should check into the Raspberri Pi because of how cheap it is.

    The Windows Surface RT uses an ARM cpu at it's core, meaning it cannot run or execute traditional x86 platform code (code compiled for the x86 architecture). Instead it can only run software compiled for the ARM architecture or architecture independent software (such as javascript/html5). The Windows Surface Pro uses a traditional x86 architecture cpu at it's core, meaning it can run any traditional software without recompile. Since you are writing your software for the first time, you will need to decide what your target devices are. I think for simplicity, you will want to compile your java code on an ARM device for ARM devices since the Java Embeded JDK may or may-not have special libraries are libraries that are excluded, although I may be wrong here and compiling java code on any system might work just fine for an ARM cpu target.

    Hope that lifts some of the fog... if not, post back and we can continue the discussion. :)
    Hi SnakeDoc,

    thank you for your prompt reply and thanks for your enlightenment. I'm sorry but I'm still a little confused, though a lot better now.

    I googled Raspberry Pi and came across a hardware that some what looked like a RAM/mini motherboard, which is why I asked if it was a processor. So basically, if I purchased one, I would have to connect it to my CPU and then boot it up through that hardware?

    You mentioned about Windows Surface RT as well as Windows Surface Pro. In simple terms, Windows Surface Pro acts like a normal cpu on a tablet, am I right to say that? So, that would be able to compile and run any software that I am able to run on a normal desktop/laptop, if I'm still right here.

    As for Windows Surface RT, does this mean I would have to install the Java Embedded to have it run my Java files? If so, does it run .jar files like how we would run them on a desktop?

  9. #9
    SnakeDoc is offline Senior Member
    Join Date
    Apr 2012
    Posts
    129
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Quote Originally Posted by rhexis View Post
    I googled Raspberry Pi and came across a hardware that some what looked like a RAM/mini motherboard, which is why I asked if it was a processor. So basically, if I purchased one, I would have to connect it to my CPU and then boot it up through that hardware?
    Not correct. The Raspberry Pi is a full computer. It has a SoC (System on Chip) which includes it's CPU, RAM, and some other stuff that makes video and networking work, etc. The Raspberri Pi does not have nor does it use a traditional storage device such as a Hard Drive to store the Operating System on. Instead, it has a SD Card slot that you can put in any size SD Card (up to 64GB i think). To install the OS (linux -- recommened the Raspbian “wheezy” image downloadable on the raspberrypi.org website) you must use the linux tool "dd" to clone the image to your SD card then use something like gparted to expand the image to fill your size SD Card. In windows, there is a tool that will clone the image to the SD card and then resize it for you. See the "Getting Started" PDF guide available on their site. The only thing the Raspberry Pi does not have is a power supply... it is powered over USB connecting to the micro-USB port on the Raspberry Pi. This is the same cable that just about every cell phone (except Apple's **shakes angry fist**) use to charge, so most people already have one or more available. The CPU on the Raspberry Pi is an ARM v6 cpu. This is why I was recommending it as a very cheap ARM development platform. It's a full computer and has an ARM cpu, making it great for testing out code that is targeted at ARM devices (such as tablet

    Quote Originally Posted by rhexis View Post
    You mentioned about Windows Surface RT as well as Windows Surface Pro. In simple terms, Windows Surface Pro acts like a normal cpu on a tablet, am I right to say that? So, that would be able to compile and run any software that I am able to run on a normal desktop/laptop, if I'm still right here.
    You are correct here. The Pro tablet has a regular x86 architecture CPU in it (i think it's an Intel i3 if I'm not mistaken). This means any code targeted at the x86 architecture (including x86_64, which is 64 bit) will run on this device. The RT tablet uses an ARM architecture CPU and therefore can only run software written and compiled for ARM devices. This means regular "desktop apps" will not run on the RT tablet unless you remake/recompile them for that target CPU architecture. Now, Java has the greatness of being mostly cross-platform capable meaning your code that runs on a JVM on an x86 architecture machine will indeed run on an ARM architecture machine, so long as there is a JVM there to execute the code -- this means on ARM devices you need either the Java Embedded as we discussed, or I think OpenJDK will do it also (but will be harder to get installed since it's not an easy download and run like Java Embedded has from Oracle). So essentially, and ARM devices (RT Tablet in your case) that you wish to run your java code on will need a JVM installed that is compatible with the ARM cpu. Once you have a JVM installed on your device, it will run Java (the beauty of Java).

    Discussing Android tablets is slightly different because as I mentioned before, Google stripped out a lot of stuff from the standard java libraries, such as AWT and SWING. But, if your Java code does not try to use any of the libraries/classes that Google removed, then your code will indeed run on the Android. You will need to test it though because Android may limit what your application is capable of doing (such as reading from certain locations in the file system, in order to prevent malicious code from causing harm).

    Quote Originally Posted by rhexis View Post
    As for Windows Surface RT, does this mean I would have to install the Java Embedded to have it run my Java files? If so, does it run .jar files like how we would run them on a desktop?
    The answer to this is really part of my answer in my last paragraph. Yes, it will run a .jar file so long as the JVM is present for it to run on top of. Getting the JVM installed on all those RT tablets will probably be your greatest challenge since it's not trivial for a "normal" user. Most people are now trained to get software from the devices supported marketplace (especially on tablets and phones, and now more so because even windows 8 has it's own market). So browsing the internet and downloading some file then installing it is really out of a "normal" users way. If you or your IT department are handling the device deployments though, then this may be less of a problem because you can give the device to the user with the JVM pre-installed and configured, as well as already have your app setup.

    Hope that helps!
    rhexis likes this.

  10. #10
    rhexis is offline Member
    Join Date
    Nov 2011
    Posts
    56
    Rep Power
    0

    Default Re: Is it possible to code a Swing application and run in on a Windows Tablet?

    Quote Originally Posted by SnakeDoc View Post
    Not correct. The Raspberry Pi is a full computer. It has a SoC (System on Chip) which includes it's CPU, RAM, and some other stuff that makes video and networking work, etc. The Raspberri Pi does not have nor does it use a traditional storage device such as a Hard Drive to store the Operating System on. Instead, it has a SD Card slot that you can put in any size SD Card (up to 64GB i think). To install the OS (linux -- recommened the Raspbian “wheezy” image downloadable on the raspberrypi.org website) you must use the linux tool "dd" to clone the image to your SD card then use something like gparted to expand the image to fill your size SD Card. In windows, there is a tool that will clone the image to the SD card and then resize it for you. See the "Getting Started" PDF guide available on their site. The only thing the Raspberry Pi does not have is a power supply... it is powered over USB connecting to the micro-USB port on the Raspberry Pi. This is the same cable that just about every cell phone (except Apple's **shakes angry fist**) use to charge, so most people already have one or more available. The CPU on the Raspberry Pi is an ARM v6 cpu. This is why I was recommending it as a very cheap ARM development platform. It's a full computer and has an ARM cpu, making it great for testing out code that is targeted at ARM devices (such as tablet



    You are correct here. The Pro tablet has a regular x86 architecture CPU in it (i think it's an Intel i3 if I'm not mistaken). This means any code targeted at the x86 architecture (including x86_64, which is 64 bit) will run on this device. The RT tablet uses an ARM architecture CPU and therefore can only run software written and compiled for ARM devices. This means regular "desktop apps" will not run on the RT tablet unless you remake/recompile them for that target CPU architecture. Now, Java has the greatness of being mostly cross-platform capable meaning your code that runs on a JVM on an x86 architecture machine will indeed run on an ARM architecture machine, so long as there is a JVM there to execute the code -- this means on ARM devices you need either the Java Embedded as we discussed, or I think OpenJDK will do it also (but will be harder to get installed since it's not an easy download and run like Java Embedded has from Oracle). So essentially, and ARM devices (RT Tablet in your case) that you wish to run your java code on will need a JVM installed that is compatible with the ARM cpu. Once you have a JVM installed on your device, it will run Java (the beauty of Java).

    Discussing Android tablets is slightly different because as I mentioned before, Google stripped out a lot of stuff from the standard java libraries, such as AWT and SWING. But, if your Java code does not try to use any of the libraries/classes that Google removed, then your code will indeed run on the Android. You will need to test it though because Android may limit what your application is capable of doing (such as reading from certain locations in the file system, in order to prevent malicious code from causing harm).



    The answer to this is really part of my answer in my last paragraph. Yes, it will run a .jar file so long as the JVM is present for it to run on top of. Getting the JVM installed on all those RT tablets will probably be your greatest challenge since it's not trivial for a "normal" user. Most people are now trained to get software from the devices supported marketplace (especially on tablets and phones, and now more so because even windows 8 has it's own market). So browsing the internet and downloading some file then installing it is really out of a "normal" users way. If you or your IT department are handling the device deployments though, then this may be less of a problem because you can give the device to the user with the JVM pre-installed and configured, as well as already have your app setup.

    Hope that helps!
    Thank you so much for this input SnakeDoc. Your information has helped me a lot as now I can argue that we can purchase a Microsoft RT instead of a Surface Pro, which cuts cost by quite a bit. Although this is not an official application or anything, but just an assignment, it still helps to know this much and be able to argue on it. Thank you again.

Similar Threads

  1. Swing application not compatible on Windows 7
    By patiwari in forum AWT / Swing
    Replies: 1
    Last Post: 10-03-2011, 02:01 PM
  2. How to Integrate my Java Swing App with my Windows OS
    By peterorparker in forum AWT / Swing
    Replies: 2
    Last Post: 08-05-2011, 11:07 PM
  3. windows CE+ Swing + jexcel api
    By victorroa in forum AWT / Swing
    Replies: 0
    Last Post: 03-21-2011, 03:30 PM
  4. EventHandling code for Swing application
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-07-2007, 12:06 PM
  5. Create Windows, Applet & Swing
    By Eric in forum AWT / Swing
    Replies: 1
    Last Post: 07-05-2007, 06:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •