Help: How can I read an integer from keyboard

Hi,
I am new to java, and I know how to declare integer variable,
but how can read an integer input from keyboard and assign it
to the variable.
Can anyone help me on this.
Thanks
Studentfj

the easiest way is to
import javax.swing.*
and use the methods and functions in there
otherwise from command line i think as far as i remember it is System.in

Similar Messages

  • How can I read text files from LAN if I only know the hostname?

    I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
    <p>1. How can I read text files from LAN if I only know the hostname, or IP address?
    <p>2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.
    (ex. how can I read the 120th line?)
    <p>Please help!
    <p>sorry for the bad english

    I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
    1. How can I read text files from LAN if I only know the hostname, or IP address?You need to know the URL of the file. You need to know the hostname, port, protocl and relative path.
    The hostname is server, not file.
    2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.Use the seek() to get to a random byte.
    (ex. how can I read the 120th line?)The only way to find the 120th line is to read the first 120 lines. You can use other file formats to find the 120th line without reading the whole file but to need to be able to detremine where the 120th line is

  • How can i read a document from a scanner machine in java

    I am building a application and i want to read the document from the scanner
    how can i read a document from a scanner machine in java
    So pls help me on this issue

    Probably not via a network.
    http://www.javaworld.com/javaworld/jw-07-2002/jw-0726-twain.html

  • How can i  read a image from a oracle DB?

    How can i read a image from a oracle DB?
    Because in the DB a have a field that is a picture that i would like to show in a jpanel.....but this field is in oracle DB only has strange caracters ..... so Do i have to read this field like a input stream?....
    Could some body help me please?
    Thanks...
    Mary

    Well I suppose the picture is stored in a blob. If that is so this is some code I have used to load a picture to a panel. Hope you find it usefull.
    PreparedStatement retreive = db.createPreparedStatement("select bl from test where ln = ?");
    Blob bl;
    try{
    retreive.setBigDecimal(1, new BigDecimal(jTFln.getText()));
    ResultSet rs = retreive.executeQuery();
    if (!rs.next())
    System.out.println("Empty Result Set");
    bl = rs.getBlob("bl");
    if (bl == null) {
    System.out.println("Null Blob");
    return;
    InputStream is = bl.getBinaryStream();
    int imageLength = (int) bl.length();
    System.out.println(imageLength);
    System.out.println(bl.length());
    byte[] imageData = new byte [imageLength];
    is.read(imageData, 0, imageLength);
    image1 = new ImageIcon(imageData);
    photo = new JPanel() {
    public void paint(Graphics g){
    g.setColor(Color.lightGray);
    g.drawImage(image1.getImage(), 0, 0, this);
    } catch (BadLocationException ble){
    ble.printStackTrace();
    } catch (SQLException sqle){
    sqle.printStackTrace();
    } catch (IOException ioe){
    ioe.printStackTrace();
    }

  • How can I read pdf files from LabVIEW with different versions of Acrobat reader?

    How can I read pdf files from LabVIEW with different versions of Acrobat reader?
    I have made a LabVIEW program where I have possibility to read a PDF document.  When I made this LabVIEW program it was Acrobat Reader 5.0.5 that was installed on the PC. Lather when the Acrobat Reader was upgraded to version 6.0, there was an error when VI tries to launch the LabVIEW program. And Later again when we upgraded to Acrobat Reader 7.0.5 I must again do some changes and rebuild the EXE files again
    It isn't so very big job to do the changes in one single LabVIEW program, but we have built a lot of LabVIEW programs so this take time to due changes every time vi update Acrobat Reader. (We have build EXE files.)
    The job is to right click the ActiveX container and Click "Insert ActiveX Object", then I can brows the computer for the new version of acrobat Reader. After this I must rebuild all the "methods" in the Activex call to make the VI executable again.
    Is there a way to build LabVIEW program so I don't have to do this job every time we update Acrobat Reader?
    This LabVIEW program is written in LabVIEW 6.1, but I se the problem is the same in LabVIEW 8.2.
    Jan Inge Gustavsen
    Attachments:
    Show PDF-file - Adobe Reader 7-0-5 - LV61.vi ‏43 KB
    Read PDF file.jpg ‏201 KB
    Show PDF-file - Adobe Reader 5-0-5 - LV61.vi ‏42 KB

    hi there
    try the vi
    ..vi.lib\platform\browser.llb\Open Acrobat Document.vi
    it uses DDE or the command line to run an external application (e.g. Adobe Acrobat)
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • How can i Read a book from my Mac (digital editions) to my iPad 2

    How can i Read a book from my Mac (in digital editions) to my iPad 2

    iPad's aren't supported by ADE.  Some folks have been able to use iTunes to
    do the transfers, and others have used Bluefire reader.
    ===================

  • HOW CAN I READ A BOOK FROM MY IPAD/IBOOK ONTO MY TV

    HOW CAN I READ A BOOK FROM MY IPAD/IBOOK ON MY TV SCREEN?

    Apple TV: How to use AirPlay Mirroring
    Troubleshooting AirPlay and AirPlay Mirroring
    OR
    You can use the Apple Digital AV Adapter or VGA Adapter to share the display of your iOS device to a compatible TV, projector, or other external display.

  • Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    The Mac OS X and iOS versions are separate products

  • How can we read some bytes from every line of the file

    How can we read some bytes from the every line of the file moving on to the next line
    without using the read line

    Actualiy readLine() takes more execution time
    for reading a part of line if we can do so without
    readLine() we can save some time...Well, if you knew, beforehand, the length of each line, you could use RandomAccessFile and its seek method, but, since you don't, you would have to read the rest of the line character-by-character, checking to see if it is a newline, in order to place the "cursor" at the beginning of the next line in order to read the next few characters you want.
    So, as you can see, you will need to read the entire line anyway (and if you do it yourself you also have to do the checking yourself considering all three possible end-of-line sequences), so you just as well use readLine().
    Some people may suggest Scanner and it's nextLine() method, but that also needs to read the rest of line (as evidenced by the fact that it returns it), so that is no different than the readLine() (or read it yourself) solution.

  • Please help-how can I find accents on the keyboard when typing in French?

    Please help.How can I find accents on the keyboard when typing in french?Thanks

    You can also open the Keyboard Viewer & hold Option key & Shift+Option to see...
    Option key...
    Shift+Option or alt key...

  • How can I read books purchased from iBooks on my Mac?

    I'm completely new to the whole Apple world and have ran across this issue.  How can I read books, that I've purchased through iBooks on my iPad or iPhone, on my Mac?  Surely this is possible, but I just can figure out how Apple intends for us to do this.
    If someone could please help me out with this information I would appreciate it.

    Or I can just purchase them from a competitor such as Kindle and read them on my Mac
    Sure seems short sighted on Apple's part not to have this functionality.  This will drive my purchasing decisions to Kindle.
    I'm sure that there has been plenty of negative feedback already directed to Apple for this decision.  Does anyone know whether or not they have listened and if they have any plans to correct this issue?

  • How can I read epub ebooks from public libraries?

    Hallo,
    how can I read ebooks in epub format I have downloaded from public library on the iPad? They are valid for 7 days, I can open them with Adobe Digital Edition.
    I get them into iTunes, I even get them on the iPad. But I am getting an error message when I try to open them with iBook.
    If iBook can't read them, is there another app I could use?
    Hopefully somebody could help.
    Thanks, foxbetti

    how can I read ebooks in epub format I have downloaded from public library on the iPad? They are valid for 7 days, I can open them with Adobe Digital Edition... If iBook can't read them, is there another app I could use?
    You've answered your own question. Basically, you use Adobe Digital Editions (or Sony Reader Library) software which is keyed with your valid Adobe ID to manage content downloaded to an "authorized" computer for transfer to compatible "authorized" mobile devices. However, as far as I know at this time, the iPad is not yet supported by either application.
    Here is what Adobe says:
    Some digital publications that you purchase online or check out from a library may contain digital rights management (DRM) protection that restricts the items from being shared with others. In the past, this could limit the ability to read your items on additional computers owned by you. It could even prevent you from moving your items when you bought a new computer.
    Digital Editions helps ensure that your eBooks and other digital publications are not "locked" on one computer — they are assigned to you through your Adobe ID. Digital Editions also adds support for the next generation of mobile devices.
    Adobe membership is free and registration only takes a minute. As a member, you have access to trial downloads, hundreds of free product extensions, and special community areas. Your membership also allows you to view and manage your activity in the Adobe Worldwide Store.
    An Adobe ID is a free and a nonintrusive way of identifying users — you need only provide a name, country, and e-mail address. You can create your Adobe ID when prompted within Digital Editions as you authorize your computer, or go directly to the Adobe.com membership site.
    Once you authorize your computer with Digital Editions, the application looks for eBooks already on the computer and converts copies of the items to a new named account license. You can then transfer those eBooks to other computers. If you have eBooks on multiple computers, you need to authorize each one with Digital Editions prior to transferring eBooks between them.
    Important: Digital Editions converts eBooks that have been purchased with Acrobat, Reader, or earlier versions of Digital Editions. However, items licensed using Easy Activation can only be converted on the same computer with which they were originally purchased. If you are contemplating buying a new computer, changing the hard drive, or upgrading the operating system, consider keeping your old computer intact unless you bought all of your books with Acrobat or Reader using Named Activation.
    Digital Editions detects borrowed eBooks and displays them in the Borrowed bookshelf. However, if you borrowed an eBook with Acrobat or Reader, you cannot transfer that book to another computer. You must return the library item and then borrow the item again using the current version of Digital Editions.
    Digital Editions does not require you to authorize your computer with an Adobe ID. This option is necessary to address concerns about some users' needs for privacy (for example, library patrons and minors). However with this option, protected items that you have already downloaded or will download later are tied to that particular computer and are not readable on other computers or devices. They also can't be restored from backup if the operating system is reinstalled.
    When you first launch Digital Editions, you are prompted to authorize your computer. You can decline, in which case your digital content will belong to the computer, not a named user account. Subsequently, you will be prompted to authorize your computer whenever you purchase an eBook, although the prompt dialog box provides a"“Don’t ask me again" checkbox.
    Digital Editions has an “Authorize this computer” menu item that you can use after initial installation.
    Important: If you authorize your computer with an Adobe ID, then it will always be associated with that Adobe ID. If you do not, the account is "anonymous". If you "anonymously" activate two computers, then there are two separate anonymous accounts, which cannot be merged. Thus, the eBooks on one computer can be upgraded to "belong" to a specific Adobe ID, but the eBooks on the other cannot. If you authorize the second computer with your Adobe ID, any subsequent purchases on it are associated with that ID and transferable to any computer authorized with that ID. However, the books that were purchased on the second computer prior to being activated are forever locked to that computer.
    You can activate up to six computers and six devices . If you reach the limit, contact Customer Service to increase your allowable activations. --Adobe Web Site

  • How can I read the image from database into form

    hi everyone
    if I have table like this
    create table test
    (id number(10),
    pic long raw);
    in this table record
    in form If I have block non database
    how can i read the image into non database item
    I try with this code but no good
    select pic into :photo from test where id=5;
    photo its non database item kind image
    how can i invoke image into item
    thanks alooooooot

    Hello,
    You can't select image with select query. You need to create another database block from test table which has item binds with database pic column. Now in where condition in test block's property you have to write id=5. Change test block's properties UPDATE ALLOWED, INSERT ALLOWED, DELETE ALLOWED to NO. Only Query allowed property set to YES.
    Now in your particular trigger write the code
    GO_BLOCK('test');
    Execute_Query;
    please mark if it help you or correct
    Regards,
    Danish

  • How can I read a comment from an lvm?

    Hello,
    I created an lvm using the Write to Measurement File express vi and I added a comment.
    To simplify it the line of the lvm created was:
    5 test
    where 5 is a random value and test the comment I input.
    My question is how can I read this comment.
    When I use the Read Measurement File express vi, the comment output
    returns empty.
    Thank you.
    Solved!
    Go to Solution.

    Hi epik78,
    I am not sure how you are adding your comment to the file, but when I made the simple VI below, I was able to see the comment that I input to the .lvm file in the comment indicator of the Read From Measurement File.
    Regards,
    Stephen S.
    Message Edited by Stephen_S. on 02-25-2009 03:18 PM
    National Instruments
    Applications Engineering
    Attachments:
    lvm comment.JPG ‏26 KB

  • How can i read a image from clipboard

    Hi all,
     Can you anyone help me to figure out this problem,actually i have an VI that capture screen image(similiar to print screen option in windows) & save it in a file.and now the thing is,its working in code,once if i converted that to EXE it is not reading that image from the clipboard .I have attached that VI along with this thread please check it.
    Attachments:
    Clipboard.vi ‏20 KB

    Hey,
    It seems that the Get Image from Clipboard method is not available for executables.
    The following thread gives a working example with a CIN -> http://forums.ni.com/ni/board/message?board.id=170&message.id=35987&requireLogin=False
    Christian

Maybe you are looking for

  • OS-DB Migration [ Import Error ]

    Hello, We are doing the OS-DB Migration and on the last stage of the import... We had 38 processes,out of which 37 are completed successfully... SAPAPPL0 is giving error... Kindly please suggest... trying to restart import ### (RIM) WARNING: unable t

  • HT201210 I have the problem on my I phone 3Gs there is an error 1015 need help

    Hello there I need help with my I phone 3Gs, there is an error 1015 when I started updating the new version for I phone  and there it is a problem so help me thanks

  • HT201210 Restore issues iphone 3G

    Hello I followed the advice of this article http://support.apple.com/kb/HT1808 and I managed to restore my iphone via iTunes without an error. Once the restore was done the apply logo came on the screen, some progress bars appeared and then nothing,

  • Create database tables from an xsd

    Is it possible to generate database table from a given xsd using toplink ? I want to use these tables to persist java objects obtained by unmarshalling the xml (corresponding to this xsd). Thanks in advance, Mahima

  • Sorry!

    Hi, firstly I think I am posting in the wrong place so sorry about that but I wanted to know what is the best virus protection software for Mac OSX, I am on 10.4.4 on an intel i mac. Secondly is there anyway of scanning my machine for a virus without