JTextField: How to fill it with a "number" instead of with "text"

Hi everybody,
I want to fill a JTextField variable with "something" that is actually a number (an int variable). How could I do it? I can not cast from int into string...
Thanks a lot!
Fran.

Hi,
I've implemented number fields based on JFormattedTextField. Maybe you find them usefull (the library is Open Source):
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JRealNumberField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JDoubleField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JFloatField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedRealNumberField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedDoubleField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedFloatField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JWholeNumberField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JByteField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JIntegerField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLongField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JShortField.html
Tutorial:
http://softsmithy.sourceforge.net/lib/docs/tutorial/swing/number/index.html
Homepage:
http://www.softsmithy.org
Download:
http://sourceforge.net/project/showfiles.php?group_id=64833
Source:
http://sourceforge.net/svn/?group_id=64833
http://softsmithy.svn.sourceforge.net/viewvc/softsmithy/trunk/lib/src/org/softsmithy/lib/
API:
http://softsmithy.sourceforge.net/lib/docs/api/index.html
If you want to use the fileds in a table have a look at the source code of JXTable:
http://softsmithy.svn.sourceforge.net/viewvc/softsmithy/trunk/lib/src/org/softsmithy/lib/swing/JXTable.java?view=markup
If you want you can use it or one of its subclasses (JCellTable, JPropertyTable) and set the default editors.
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JXTable.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/DoubleCellEditor.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/FloatCellEditor.html
-Puce

Similar Messages

  • How to fill the whole screen of my iMac with the photos included in an iDVD project. (iDVD v. 7.1.2)

    How to fill the whole screen of my iMac with the photos I included in an iDVD project. (iDVD v. 7.1.2). I mean, during playing the burned dvd.
    When I do "Enter Full Screen", the slide show fills the screen but the photo itself remains in the middle with a wide black border filling the rest.
    Any cure for this ?

    Hi
    In iDVD Preferences - Turn off - TV-Safe area - and the Photos will fill the full area with just letterboxing or pillars as max.
    Then "Save as a DiskImage" and test this and see if this plays better - before burning DVDs that's not as You want them.
    Bengt W

  • My sprint service is off. How can I still use that number for iMessage with wifi instead of my apple id

    My sprint service is off. How can I still use that number for iMessage with wifi instead of my apple id?

    You can't. You can only use that number if you have active service.

  • How to fill the details tab in tv shows with description

    Can anyone tell how to fill out the details tab metadata in the tv shows section of iPad? The tv shows purchased from the iTunes Store have the details tab beside the episodes tab filled in with helpful description about the show. Isn't there a way to do that manually for personally downloaded tv shows? It's not possible to buy every content from the iTunes Store. Please help if anyone know how to add description to tv show details.

    see your duplicate thread : How to fill the details tab in the iPad tv shows with description

  • How can we keep/save EAN11 number (MEAN-EAN11)  with leading chars '00'

    We're using EAN categoties UC and UA.
    Only difference between UC and UA is that the EAN number with category UA has leading two characters '00'.
    For example if EAN number for UC is '9123456789' then EAN no for UA will be '009123456789' and we want to save it that way in SAP (table MEAN).
    But, the conversion exit for EAN11 stips off thhe leading '00' for the EAN no with UA category and thereby making it same as the one with UC.
    I've played with EAN/UPC attributes in IMG and also used the BADI BADI_EAN_SYSTEMATIC to add leading '00' the but still SAP takes out the leading '00'. 
    Could you please suggest how can I make SAP to keep/save leading '00' for MEAN-EAN11 field when MEAN-EANTP = 'UA'??

    Hi friends,
    My general problem is that I'm using the idoc ARTMAS05 but when to load data delete leading zeros in EAN fields.
    Example of my problem:
    I have a article with this ean code 0056789 and have other article with this ean 00056789, but when to load data the second article it is no stored because shows error message "Ean code already exits". Now I´m finding the way for to be able to load the zeros of the ean.
    I have 23000 article with this problem.
    Thank...

  • How to fill pre-defined tables in Word 2003 with test results?

    Hi All,
    I have a simple test board , where i measure different DC levels,  with a simple Vi that saves the test results in to a Text file.
    These results in text file, were manually typed in to a test report , which is a Word document with tables, but i have now created a macro in word 2003 that can take the results from text file and added to the specific rows and columns in  my word test report file.
    The big questions is how can i get Labview to,after it has measured the DC levels, write the test results to the specific tables , rows and columns, in the Word document without deleting all?
    The attached picture illustrates one tables , and the yellow cells showing the cells that need to be filled in with test results.
    Labview vers: 2009
    Solved!
    Go to Solution.
    Attachments:
    Template.jpg ‏37 KB

    Hi!
    I'm a Test Engineer for electronics and I create alot of automated tests with LabVIEW. Many of our customers want testsresults in a fancy and easy-to-read report. I did not have the MS Office Report Generation tool. So I did some research in the Excel Board and came a cross a link to a free open Excel toolkit ( Link ). The toolkit looks like this in LabVIEW:
    As you can see, you have many tools to get the job done. I'm talking about reading, writing and formatting Excel. The toolkit uses activeX. If you give me a few minutes I'll create an example for you.
    What I do when I create a report:
    Step 1. Create a template with all your formatting, macros, images and colors. Name the file for example "template.xlsx" (or .xls if you use an older office version).
    Step 2. In your program, copy the file to the desired location and give it a proper name.
    Step 3. Aquire some data and write it to the file you copied and renamed.
    For my latest project I created a fully-automated testprogram for testing a electric product. After each test a report is generated based on the procedure above. After testing all the products I have for example 300 reports. I then created a program that reads all the reports and creates a summary report that contains statistics for all the tested products. In my program I can also print the reports or the summary report and deliver to our customer. All this takes just a few seconds and adds extra quality to the products we sell to our customer.
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway

  • How do I get my cellphone number to work with my MacBook and my iPad.. Right now it only uses my icloud email???

    I am trying to reconnect my ipad with my cellphone number.. so I can send and recieve from two different sources.. "905-999-9999" and "[email protected]" does anyone know how to do this? I had it before..

    I want to be able to send iMessages from my iPad using my phone number rather than just my icloud email... I had it before on both the MacBook and iPad but now it just stopped working..

  • How to configure JSpinner to accept number of hours (with mins and secs)

    I'm having a problem trying to figure out a simple way to enable a JSpinner to do allow the input in this format:
    n hours : n minutes : n seconds
    ex: 100 : 0 : 0, 1:59:59, 25:30:00
    Where n hours could be from 0-n (not restricted by 24 hours) and minutes and seconds are, of course, < 60. That is, I can enter number of hours, not a date, or a specific time in a day.
    I'm thinking the only way to do this is with a custom spinner model and custom editor? Or is there a simple way I can make the date model in spinner to allow me to do this?
    Thanks

    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Test2 extends JFrame {
      public Test2() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        content.setLayout(new FlowLayout());
        content.add(new MySpinner());
        setSize(300, 300);
        setVisible(true);
      public static void main(String args[]) { new Test2(); }
    class MySpinner extends JSpinner {
      public MySpinner() {
        setModel(new SpinnerDateModel(
          new GregorianCalendar(2004,0,1,0,0,0).getTime(),
          null, null, Calendar.DAY_OF_YEAR));
        setEditor(new DateEditor(this,"HH:mm:ss"));
    }???

  • How do i use my phone number instead of my apple id for imessage on my iphone5?

    I accidentally selected my apple id for sending and receiving imessages. I want to be reached at my phone number and not my email first, but I can't figure out how to make my phone number the primary and my email the secondary.
    Also, my son and I are in a text message mode between our phones (both apple products) and we can't figure out how to get back to imessage mode. We have both powered off and shut down imessage and we are still going green to each other.

    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support

  • Locating row with invalid number from  table with few million rows

    We need to query the a table or a view of same to obtain a id of type VARCHAR with bind value being NUMBER. Any attempts in this regard I try seem to result ORA-01722: invalid number. Once case is below here
    SQL> select TEXT_ID FROM ATT_TABLE where to_number(TEXT_ID) = 9411956;
    select TEXT_ID FROM ATT_TABLE where to_number(TEXT_ID) = 9411956
    ERROR at line 1:
    ORA-12801: error signaled in parallel query server P010
    ORA-01722: invalid number
    1. TEXT_ID column is meant to have numeric values in VARCHAR type. It is possible that some record / row is not complying. How can I locate the non-complying records ?
    2. What would be a VIEW definition that would return only records with valid numeric data in TEXT_ID column.
    Edited by: bonjonbovi on Feb 13, 2009 3:58 PM

    Of course the regexp_like is really cpu expensive, but there's no other solution in your situation
    The only way to differ numberic value from character, is REGEXP_LIKE function
    But you can do it using PL/SQL
    BEGIN
       FOR c IN (SELECT TO_NUMBER (ID) ID
                   FROM test_number)
       LOOP
          DBMS_OUTPUT.put_line (c.ID);
       END LOOP;
    EXCEPTION
       WHEN OTHERS
       THEN
          NULL;
    END;

  • How can i change to my number instead of apple id email for imessage?

    i have an iphone 4 and i cant imessage most people who have an iphone and the one person i can it just shows my email but it the pic help ive seen on here it has 2 choices email or number but how do i change to number hellpp!!!

    It's supposed to look something like this. http://gigaom2.files.wordpress.com/2011/10/crump-imessage-setup.jpg?w=604&h=353
    First, make sure the iMessage toggle is actually turned ON. Then, go into "Recieve At" or "Send & Recieve" (depending on your iOS version) and make sure your phone number is the only thing that's checked.

  • Posting Goods Receipt with ASN number in ECC with Message type: MBGMCR

    We are using Basic Idoc Type :MBGMCR02 to Post Auto Goods Receipt in ECC.
    This happens when external system ( 3rd Party System) sends this message which in turn posts the GR in ECC.
    Thru Goods Movement BAPI
    My Question is CAN WE POST auto goods receipt thru MBGMCR02 with Inbound delivery as reference document - Instead use ASN ( Advanced shipping notification ) which is Reference document in inbound delivery to Post Goods receipt in ECC.
    This is required for our integration peice with 3rd party system.
    And also pl let me if we can use Basic types MBGMCR01 or MBGMCR03 to post auto goods receipt in ECC with reference to PO which has confirmation control key set and instead of passing inbound delivery number can we pass ASN number which is external delivery ( Reference ) number and post goods receipt successfully in ECC.
    Would appreciate your immediate help in this regard.
    Regards,
    Mahesh

    Thank you Vinod.
    We are using MBGMCR02 to post Auto GR by using BAPI - Inbound into ECC.
    We have a 3PL scenario where third Party system will push this message to us ( ECC) which in turn post Auto Goods receipt.
    Here is the process:
    Systems involved : SNC / ECC / 3rd Party
    ASN gets published in SNC  which in turn posts inbound delivery in ECC and a copy of Inbound delivery with SNC ASN number is sent to third party system.
    Third party system is the Carrier ( shipper) they in turn send us the shipment confirmation when they send the goods.
    When they send it to our ECC we have MBGMCR02 to post Auto GR in ECC thru BAPI calling MB_GOODS_MOVEMENT
    This will post the GR with respect to inbound delivery- That works fine..
    Now we are testing an scenario where instead of sendindg ASN to 3rd part system from ECC after Inbound delivery is created.
    We want to send the ASN information ( Which will have PO number as well ) without  ECC 's inbound delivery number directly to 3rd party system  after ASN gets published in SNC thru PI - This is before inbound delivery is created in ECC.
    And the requirement is when 3rd Party system sends the shipment confirmation to ECC  - They will send ASN ( SNC ASN) and ECC  PO number with quantity , vendor , movement type :101 , movement indicator etc -  CAN in ECC when you send these information without inbound delivery posts Auto Goods receipt.
    Based on SNC ASN which is external delivery number in ECC as per PO / Reference number in Inbound delivery document.
    Can MBGMCR01/ 02 / 03  posts GR in ECC with these information ( Mean without the ECC inbound delivery number )
    Which will allow us to avoid the step of sending ASN information along with inbound delivery to 3rd party system after inbound delivery is created - Instead will send directly from SNC / PI / 3rd party
    Point to be noted is - These are SNC PO's which will always have confirmation control key.
    When 3rd part send the shipemnt confirmation with SNC ASN number and PO number while posting Idoc in ECC any of MBGMCR idoc types should check / search for inbound delivery associated and post the GR in ECC
    Can you pl let me know your thoughts pl
    Thanks,
    Mahesh

  • Problem with counting number of clic with initialize mouse vi

    Hi,
    I want the vi stops when the user clics several times with the mouse. I use initialize mouse vi instead of event structure for other reasons (I can't use it).
    I intented to count the number of clics and when this number of clics occur, the vi stop. But the vi don't work, it stops at the first clic although when i highlight execution it seems to work as I want.
    I send here the vi.
    If someone could help me, thanks in advance.  
    Attachments:
    number of clic.zip ‏24 KB

    Hi,
    The problem is the execution time, if you push the mouse button your program will execute number of times before you lose the button agian. Even if you push it realy fast.
    I made some changes to your code there i wait until button is released befor continuing.
    Regards
    /Thomas
    Attachments:
    number of clic Folder.zip ‏20 KB

  • Problem with great number of  connections with jolt

    My application connects to Jolt using the java API. The two kind of object i am using
    are JoltSesion and JoltService. i tried
    to use several service within the same session and tried one service per session.
    The two solutions gave me the same result in case of a great number of simultaneous
    connections: Jolt
    doesn't accept any more connections and my java program receive
    errors like RESCON FAILED, CHALLENGE FAILED...
    can Jolt support more than 20 connexion per sec ?? and if this
    the case, what are the parameters to fix to allow this ?
    Thanks in advance,
    Pierre

    Hi Ali,
    please check whether you have unchecked the  "Use Default Settings"  checkbox in the display property.
    BR
    adlin

  • How do I delete a phone number associated with iMessage?

    My husband bought an iPhone and he set up his Apple ID.  Now his phone number is associated with my iMessage account along with my number.  When someone texts me he gets it too.  When we text someone else they get the text from both of us.  How do I remove his phone number from my account?

    Hi Sycoffee,
    Thanks for visiting Apple Support Communities.
    It sounds like your device may be using your husband's Apple ID. You can check this from the following menu options:
    On iOS devices, find out which addresses are enabled with FaceTime and iMessage by tapping:
    Settings > Messages > Send & Receive > You can be reached by iMessage at:
    Settings > FaceTime > You can be reached by FaceTime at:
    On OS X, find out which addresses are enabled:
    In Messages, choose Messages > Preferences > Accounts. Select iMessage in the left column. Your contact preferences should appear under "You can be reached for messages at:."
    In FaceTime, choose FaceTime > Preferences. Your contact preferences should appear under "You can be reached for calls at:."
    Use these steps to unlink your phone number from his Apple ID:
    To remove a phone number from an Apple ID, sign out of FaceTime and Messages on your iPhone:
    Settings > Messages > Send & Receive. Tap your Apple ID, then tap Sign Out.
    Settings > FaceTime. Tap your Apple ID, then tap Sign Out.
    This should remove your phone number from other devices using the same Apple ID with FaceTime and Messages. If the phone number is still available on other devices after you sign out of FaceTime and iMessage on the iPhone, you may need to sign out of iMessage and FaceTime on all your devices, then sign in to FaceTime and Messages again on devices you want to use.
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Cheers,
    Jeremy

Maybe you are looking for

  • E63 sound loss

    I have no sound when playing back recorded sound clips in the "Music Plaver"  or "Gallery",   Althought these clips can not be heard in either of  these two applications the sound clips can be heard if selected as a ring tone ect.    If a video clip

  • Lsmw for qp01.

    Hello ,     I am trying to do lsmw for qp01 transaction (inspection charactoristics.)     I am using Recording method to upload the data.   i am using these fields. 1)  first screen i.e header :    MATNR                          C(018)    Material WE

  • How to return statement

    Hi Friends I want to insert values in a Table and I want one of the value as a return output, like this: INSERT INTO Employees (EmpID, Name, Designation) VALUES (111, 'Sam', 'Manager') RETURN EmpID When I execute the statement, one row should be inse

  • The slide will not open my iPad

    It comes on and is full charged, but no buttons work

  • Sender Rewriting Scheme?

    Are there any plans for IronPort to implement Sender Rewriting Scheme in AsyncOS? I'm personally not a big fan of SPF and SRS, but like it or not they're being deployed. We use a C300 to operate a mail forwarding service for our alumni (we get the fo