Hi I want  to control hardware and buid GUI from java help me

hi after learning Swing now i want to control hardwares through parallel and serial ports means control switches ON and OFF i.e bits ON and OFF and as well as read the frequency from outside and shows in the crossponding percentage according to given factor.also read the temperature signal from thermocouples.
please help me completely and give the correct versions of java technology which can i used for above purpose and with examples
specially read from the port and then write after check the status of bits.
thanks and reagards

Java programs run within a virtual machine (JVM). They have very little concept of the computer on which they are running; they only see the VM and what information it provides.
The JVM does not provide any information about the lower-level hardware, such as parallel and serial ports. On most modern operating systems, you'd have to jump through a few hoops even to get the native programs to do this job.
The only option I see for you to do this in Java is to find a JNI library that allows you to do this for your target OS(es).

Similar Messages

  • Exception when connecting to Reporting and Analysis services from Java API

    Hello,
    I'm trying to connect to Hyperion Reporting and Analysis services from Java API using [Developer's guide|http://www.bidw.in/docs/hs_developer.pdf] .
    I get this error:
    com.sqribe.rm.ReportMartException: com/hyperion/css/CSSException
         at com.sqribe.rm.SessionImpl.convertError(Unknown Source)
         at com.sqribe.rm.AASessionImpl.open(Unknown Source)
         at com.sqribe.rm.AASessionImpl.internalInit(Unknown Source)
         at com.sqribe.rm.AASessionImpl.<init>(Unknown Source)
         at com.sqribe.rm.SessionFactory.getInstance(Unknown Source)
         ...My code:
    String user = "user";
    String pwd = "password";
    String host = "my.hyperion.server";
    int port = 6800;
    try {
         Session theSession = SessionFactory.getInstance(user, pwd, host, port);
         Repository theRepository = theSession.getRepository();
    } catch (UserValidationException e) {
         e.printStackTrace();
    } catch (UnknownReportMartException e) {
         e.printStackTrace();
    } catch (ReportMartException e) {
         e.printStackTrace();
    }I have tried to look at my services running, and it all looks OK. I've checked user/passowrd/port for GSM. What can be wrong?
    I also tried to run samples from \BIPlus\SDK\samples\java, e.g. Login.java:
    #> java Login user password my.hyperion.server 6800with this effect
    com.sqribe.rm.ReportMartException: SystemExceptionError
            at com.sqribe.rm.SessionImpl.convertError(Unknown Source)
            at com.sqribe.rm.AASessionImpl.open(Unknown Source)
            at com.sqribe.rm.AASessionImpl.internalInit(Unknown Source)
            at com.sqribe.rm.AASessionImpl.<init>(Unknown Source)
            at com.sqribe.rm.SessionFactory.getInstance(Unknown Source)
            at Login.<init>(Login.java:36)
            at Login.main(Login.java:69)I'm sure that I'm connecting to the server because when put wrong passowrd or user as input to Login class I get this:
    com.sqribe.rm.ReportMartException: AUTHEN_CSSLoginFailed
            at com.sqribe.rm.SessionImpl.convertError(Unknown Source)
            at com.sqribe.rm.AASessionImpl.open(Unknown Source)
            at com.sqribe.rm.AASessionImpl.internalInit(Unknown Source)
            at com.sqribe.rm.AASessionImpl.<init>(Unknown Source)
            at com.sqribe.rm.SessionFactory.getInstance(Unknown Source)
            at Login.<init>(Login.java:36)
            at Login.main(Login.java:69)so it is there but something is wrong later. Any idea what?
    Please help.
    regards,
    Pawel
    Edited by: Paoro on 2010-09-27 02:02

    HI,
    I am getting the same error while running the Login file, Did any one resolve this issue?
    Please share the solution.
    Thanks.

  • Radio and tv tuner from java?

    Hi, is there any way to listen radio using java. I want to buy an USB tv and radio tuner. and I want to make an app to control all my multimedia stuff inclluding this tv and radio... Is this posible???? Is there any API or any programmable device for this???

    Well, just for this meant just for this card.....
    Doing a whole driver for 1 specific card (
    1.-maybe the driver development will take much more time than the app I am trying to have
    2.-It would work just for one specific device and I do not want to be limited and thats why I am looking for a java APi that abstracts this complexity.
    3.-Is not a commercial APP, I just want to play arround with this idea, and spending all the time doing something that a third party may already have done is unlogical for me. "Why to reinvent the warm water??"
    Any way, I found that JMF can do this with VFW cards. But I wanted to know if is there any prefered card to do this, or any programmable capable card with an own sdk and allows me to do this.....

  • How to insert into mysql the creation time and modification time from java?

    first how?
    Second what is better from create the date from java or do it from mysql?
    thanks in advace
    Pedro

    One way is to use the GetDate function in mysql. This will set the date as you insert data. insert into table(date) values(getdate())
    Anytime you modifiy the table just call the function again and update its fields.
    Dont know which is beter to do. In java or on the database side.

  • Unix and dos commands from Java

    How can I issue a unix command from a java program eg: setenv
    help would be appreciated

    setenv is a C shell builtin command. And it wouldn't make any sense to execute setenv from Java anyway, because the environment variable changes would only apply to that shell and possibly (if the variable is exported) to subprocesses.
    But look at the java.lang.Runtime.exec() method and the Process class.
    (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html)
    Be careful of input and output to the commands. If the command produces output and you don't read it from the getOutputStream(), your command will hang forever when the OS stdio buffer fills up. This can cause terrible random hangs. Search the forums for more on how to handle input and output. You'll probably need multiple threads to read/write the different streams. (stderr, stdout, stdin)

  • I have a new iPhone 4S that is 2 days old. I got it because my old one (6 months Old) starting loosing it's charge 5 days ago. the new one is now acting like the old one. I want to dump everything and start over from scratch but don't want to loose contac

    I have backed up all my photos which was important to me. I dont mind loosing everything except my contacts.
    I did a restore yesterday but that didn't help.

    Contacts are designed to be synced with a supported address book app on your computer where your contacts should be available with or without an iPhone or any cell phone which can be lost or stolen or damaged beyond repair.
    In addition, there are a number of free email accounts that support syncing contacts over the air not involving your computer or involving it in addition to such as with an Apple iCloud account, Yahoo, Gmail, and Hotmail.

  • I am trying to set up my billing information on my iphone and I keep gettin this for assistance contact itunes support and I just want to download apps and buy songs I need help!

    I keep getting this support pop up and I cant set up an account please help

    Go here:
    https://expresslane.apple.com/Issues.action
    Ask for assistance, as directed.

  • Advice needed about JFrame and JDialog (moved from java programming)

    My main class in my application is a page where the user can choose to register or login. This class is a JFrame. If the user chooses to register, my register dialog is called up and the parent JFrame passed to the dialog:
    private void btnRegister_actionPerformed()
                    new Register(this);
              }Same happens for login. If the user chooses to login, my login dialog comes up and my main class JFrame is set as its parent. This is all fine because all the calling up is done in my main class, so i can just use 'this' to pass the JFrame.
    Now here is my problem. If the user successfully logs in, they should have access to control some events. Now i am not sure if it will be ok to make this new events class another JFrame, as it is practically the start of a new section in my application.
    Thats my first question. My second question is if i do make this events class a JDialog, is it bad coding not to give it a parent frame? Or would this be acceptable? My worries is passing the main class JFrame to a class which is only accessable by going through two other classes.
    Cheers for the advice

    It's Simple dude,
    Advice: Use JIternalFrame, for your purpose.
    And if u want to go with JDialog than u can do that in main method. Like when u call JDialog
    Register dialog = new Register(this);Check for login in Register class or what ever u want. Create new method like success
    private boolean isSuccess() {
    return success;
    } at Register Class. After Registeration change the variable boolean success value to true or false as per logic
    And add
    Register dialog = new Register(this);
    if(dialog.isSuccess()) {
    // Show loginDialg(this) or else
    }Regards,

  • Final Cut Pro 7 - Letterbox and stretched picture from ****! HELP!

    I've edited and saved hundreds of projects without a Letterbox and stretched out picture. All of a sudden I edited and save this project and I can get rid of the letterbox. PLEASE HELP! It's awful!

    You are editing HD video shot in HDV anamorphic 16:9  on a Standard Definition 4:3 timeline.
    Is this your intention? FCP is scaling the video to fit in the 4:3 aspect ratio - hence the letterbox.
    If this is not what you want, you need to create a new (empty) sequence. Go to the menu File > New > Sequence.  Drag a source clip of your footage to the new sequence, and you should be prompted by FCP to match the sequence settings with the source footage. Click yes and you should now have a sequence that matches your source footage and the letterboxing should be gone.
    To save your existing work in the letterboxed sequence and move it to the new (correct) sequence, do the following:
    Remove the clip you used to set the sequence settings on the new sequence so that it is empty.
    Return to your incorrect sequence and click anywhere. Type Command + A to select all the clips. Type Command + C to copy them.
    Switch to the new, empty sequence and click anywhere in it. Type Command + V to paste all the clips to the new (correct) sequence.
    If the video does not display correctly in the new sequence, click anywhere on the timeline of the new sequence. Once you have done that, type Command + A to select all the clips.
    Control-click on anyone of the selected video clips, and from the drop down menu choose "Remove Attributes"
    When the Remove Attributes pane opens, check the boxes for Basic Motion and Distort (if they are not grayed out) and then click OK.
    You should be good to go.
    MtD

  • Creating and running JARs from Java programs

    OK, I have been googling and searching, but this is something I cannot work out, so I raelly need some help.
    Basically, I am building a GUI app that would generate, compile and run java programs. And I also want to enable the users to create JARs they can later double-click if they want to run the program.
    I am using Runtime to compile programs and it works just fine. When I click on a button to create a JAR, my application creates one, but when I double-click on it, it can't find main and it exits. Now that is not so much unusual, but I am positive that my manifest file is OK, because when I run the same command from the command line, then I can click on the JAR file to run it.
    So what is the deal here? I mean, why would a JAR file created from the command line run and the one created through a GUI app using the very same command could not find main?
    Any help would be graetly appreciated.

    again, another unanswered question.
    BTW I'l keep bumping these until I get an answer that works. I have been up 3 hours now trying to get this sorted and it's something that netbeans is supposed to do on its own!?!?!?!?!
    Hello, SUN, is there anyone there???
    No, didn't think so.

  • Drag and Drop file FROM Java app TO native desktop

    I'm a litte new to Drag and Drop. After a few days of looking around I've been through enough examples to copy and paste some skeleton code and get it working in my own application.
    What I haven't gotten any answers to (after searching on google, newsgroups, and here) is if it's possible to drag something from a Java app to the desktop or file browser, and have java create a file there.
    I know you can drag text to native apps, so I was wondering if you could make a Transferable object that's different than StringSelection(), like a file stream or something.
    Thanks,
    Tristan

    Tristan,
    I am stuck in the same place. Perhaps we could work on this together.
    I am trying to drag a single item from a JList to a text editor, Word, etc. I have two problems:
    1) I can't seem to get just the item in the JList to drag. It wants to drag the entire JList component.
    2) How does one define the remote application as the drop target? Have not found any examples either.
    Is the drop target actually the system clipboard?
    Rp

  • XFIRE - Java class from wsdl and soap request from java class

    Hi,
    Firstly i'm newbie programmer with little experience, so please help me if u can.
    I have found an example on how to create java classes from WSDL under maven:
    (...)<taskdef classname="org.codehaus.xfire.gen.WsGenTask" name="wsgen">(...)
    I've created the below java class and I create new object of this class: UploadChunk up = new UploadChunk()
    and up.setSomething(123) etc....
    I have some service for which I have to prepare soap request manually - suitable for my service requests.
    I'm doing it using dom4j to create xml documents and i rewrite values to it from my variable up.
    I wonder if it is possible to do it automatically - I have UploadChunk object and I want do use xFire library somehow to produce ready or almost ready soap request. I want to do it in my code, no some ant or maven task.
    So I propably need a couple line of code, when I have:
    up.setSomething(123);
    //////CONVERTION - CAN U TELL ME HOW TO DO THAT PLEASE? I haven't found the way :( it seems I need your help.
    //////Document result =....
    callService(result,namespace,qname);
    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    * <p>Java class for UploadChunk complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType name="UploadChunk">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <sequence>
    *         <element name="SessionID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    *         <element name="InputFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    *         <element name="Buffer" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
    *         <element name="Offset" type="{http://www.w3.org/2001/XMLSchema}long"/>
    *         <element name="BytesRead" type="{http://www.w3.org/2001/XMLSchema}int"/>
    *       </sequence>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "UploadChunk", propOrder = {
        "sessionID",
        "inputFileName",
        "buffer",
        "offset",
        "bytesRead"
    public class UploadChunk {
        @XmlElement(name = "SessionID")
        protected String sessionID;
        @XmlElement(name = "InputFileName")
        protected String inputFileName;
        @XmlElement(name = "Buffer")
        protected byte[] buffer;
        @XmlElement(name = "Offset")
        protected long offset;
        @XmlElement(name = "BytesRead")
        protected int bytesRead;
         * Gets the value of the sessionID property.
         * @return
         *     possible object is
         *     {@link String }
        public String getSessionID() {
            return sessionID;
         * Sets the value of the sessionID property.
         * @param value
         *     allowed object is
         *     {@link String }
        public void setSessionID(String value) {
            this.sessionID = value;
         * Gets the value of the inputFileName property.
         * @return
         *     possible object is
         *     {@link String }
        public String getInputFileName() {
            return inputFileName;
         * Sets the value of the inputFileName property.
         * @param value
         *     allowed object is
         *     {@link String }
        public void setInputFileName(String value) {
            this.inputFileName = value;
         * Gets the value of the buffer property.
         * @return
         *     possible object is
         *     byte[]
        public byte[] getBuffer() {
            return buffer;
         * Sets the value of the buffer property.
         * @param value
         *     allowed object is
         *     byte[]
        public void setBuffer(byte[] value) {
            this.buffer = ((byte[]) value);
         * Gets the value of the offset property.
        public long getOffset() {
            return offset;
         * Sets the value of the offset property.
        public void setOffset(long value) {
            this.offset = value;
         * Gets the value of the bytesRead property.
        public int getBytesRead() {
            return bytesRead;
         * Sets the value of the bytesRead property.
        public void setBytesRead(int value) {
            this.bytesRead = value;
    }

    Hi,
    Can u Please post the WSDL..here. I remember long back i resolved this kind of issue...when i was getting "*parameters is already defined in - - -*" while using ClientGen.
    Once i will get the WSDL may be i can recall it...
    If u have any problem in Posting the WSDL..in Forums .. then let me know I will send my E-Mail Address...
    As far as i remember ..it usually happens when we Run ClientGen task of WLS81 ON the WebService/WSDL generated by WebLogic 9.x or Above. Please let me know if this is the Case with you as well... . I remember there is a Patch for it...for WLS8 ClientGen task...I dont remember the Patch Number Exactly.
    Just For testing:
    Just Use WLS9.x ClientGen task On the Same WSDL
    <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
    I am sure you will not see this issue... because the issue is there only with WLS8 Clientgen...
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)
    Edited by: Jay SenSharma on Jan 8, 2010 4:32 PM
    Edited by: Jay SenSharma on Jan 8, 2010 4:34 PM

  • How to detect windows startup and appdata folder from java?

    To read the startup and appdata path I execute the following registry command and capture the foldername from the output:
    reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Startup
    The path contains the windows users name which may contain international character. The inputstream used to capture the path uses the
    default encoding of the platform but it seems to get it wrong - international characters looks wrong and any subsequent use of the path
    throws FileNotFoundException.
    What is the right way to detect theese folders or is there a fix to my current folder detection shown below?
         private static final String RESULT_TOKEN_REGSZ = "REG_SZ";
              String value = null;
              Process process = Runtime.getRuntime().exec(windowsCommand);
              BufferedReader in = new BufferedReader(new InputStreamReader(process
                        .getInputStream()));
              String line = null;
              StringBuilder sb = new StringBuilder(250);
              while ((line = in.readLine()) != null) {
                   sb.append(line);
              String capture = sb.toString();
              int pos = capture.indexOf(RESULT_TOKEN_REGSZ);
              if (pos != -1) {
                   value = capture.substring(pos + RESULT_TOKEN_REGSZ.length()).trim();
              }

    To answer my original post.
    I found what I believe is a robust (although somewhat complex if you havent touched C code i more than 10 years like me) method to read the windows registry keys.
    I call the following native windows unicode functions using the JNA api:
    advapi32.RegOpenKeyExW
    advapi32.RegQueryValueExW
    Notice the W at the end - those functions encode character strings using wide character encoding UTF-16LE (Little Endian). Now nothing is "lost in translation"...
    Wont post the kode here since it spans multiple srcfiles and is rather involved - but there are many good samples on the JNA site.

  • Read, Write and create files from java applet.

    Dear All,
    I have created a two files. One is applet and one application file. I am creating a instance of application file in applet. Application file is used for reading, writing and creating files. When I invoke applet from broser it dipslays error wrt file access permission. From the forum search I know that we need to sign the applet / edit the java policy to run the code locally. Final delivery of my code should execute on different system. Its not web. I have created a html page on submitting the form it invokes applet to read the form values from param and needs to update the values in xml file located locally. Please help me on how I can proceed with this fix.
    Thanks in advance.

    Sorry if I have not stated the problem clearly. I need to update content to files hosted in local system using java applets.
    I belive there are two ways to achive that.One with jar signer and one with modifying the java policy file. But this application needs to be installed in different system locally as I have created a application with webpage as useinterface and need to update the content in local files on submission. Not sure on how to modify the java.policy files in each end user system and whats the value we need to update in java policy file. Please help me on the steps to be followed

  • Writting java graphics and textual data from java application into MS word

    By using POI API, I could write textual data into MS word by using
    java application. Could any one help me out how to write
    Java graphics(i.e. Writting JPanel) and textual data(i.e.IOStream data) both into MS word document.
    Thank you for time spent.
    Thanks with regards,
    Mallik

    hi:
    Can any one help me out how to read and write in to the MsWord using POI...plz it is very urgent...plz give ur reply to [email protected]

Maybe you are looking for

  • How to have email conversation take on appearance of most recent message?

    I've setup a variety of email rules to change the background colour of messages based on a particular header field.  Basically, messages are coloured red, orange, yellow, or green, depending on their state in a workflow. The problem is that collapsed

  • XIR3 -SP3 - WebI Chart doesn't display

    Hi, I am experience a very strange behavior.  I create a simple chart in the webI document.  But it doesn't show at all when in viewing or editing mode. I try to export to PDF, no luck..    I check all the setting but there doesn't seem to be any thi

  • What is wrong with my tiny jdbc program? Help!!!

    Hi, Would anyone diagnose the problem of my simple jdbc program? The situation is : a) local machine oracle thin driver connection; "lsnrctl" is running. b) I can query the statement "select id from gameUser" from SQLPLUS logged in as "scott", with d

  • How to uninstall difficult software?

    I accidentally installed RegClean Pro when it popped up during a different installation and I didn't look carefully.  Now I can't get the **** thing off my computer, because I can't find the original files - they don't show up in applications or in f

  • QuickTime File Motion Stuttering Upon Display Change for Projector

    When I play my Quicktime file on my MacBook's native resolution (1280 x 800) it plays wonderfully. However when I change the display to 1024 x 768 to match the max resolution of my projector, the motion stutters quite badly. Any suggestions?