How to control the input in cell of Jtable must be number?

I want to control the character of cell or column of jtable, it must be number(0-9),
only the user type number(0-9) will show on the jtable.
how can i do that, can you give me a little example or hints?
Thanks very much!

Hi,
Your question is not that clear to me but... I believe that putting a PlainDocument class on the JTextField of the JTableCellEditor and overriding the insertString method would do the trick...
JRG

Similar Messages

  • How to control (the input and output) EXE file after I call it using exec?

    Hi,
    I knew that I can use runtime.exec() to call one EXE file, and this works. But this EXE has two characteristics:
    1. After this exe starts, it asks user to input number such as 1 or 2 onto computer screen, then press return. Then the exe will start the calculation.
    2. after it starts calculation, it prints 3 columns of numbers onto the screen.
    My two questions are:
    1. How to use java to input the number such as 1 or 2 automatically? this EXE can not work like this in DOS command line:
    C:> file.exe parameter
    The parameter is the number such as 1 or 2 that I wanna input.
    2. how to redirect the 3 columns of numbers from computer screen to txt file?
    My colleague can solve these two questions using Mathematica. So I know that definitely there is at least one solution for it. I just can not do it using Java. This wierd exe file bothered me a lot and I really wish that I can get help from someone in java community.
    Thank you!
    Tony

    When you call Runtime.exec, you get a Process object. (I presume something similar happens when you use ProcessBuilder.) Process has methods with names getOutput, getInput, and getError. These correspond to the standard input, standard output, and standard error streams of the spawned process.
    You can read and write to the process on the streams corresponding to input and output that the process writes to the console.
    [add]
    In fact, you should be grabbing and reading the output/error streams anyway, because of the points raised by the Traps article. Google "Java Runtime exec traps" and you'll probably get a link to this JavaWorld article, which describes common Runtime.exec problems and how to solve them.
    Edited by: paulcw on Jun 15, 2010 4:09 PM

  • How to control the input of TextField must be number?

    I want to control the character of TextField, it must be number(0-9),
    only the user type number(0-9) will show on the textfield,
    how can i do that, can you give me a little example or hints?
    Thanks very much!

    try with this:
    public class NumericDocument extends PlainDocument
         public void insertString(int offs, String text, AttributeSet a) throws BadLocationException
              if(text != null)
              char charArray[] = text.toCharArray();
              for(int i=0; i<charArray.length; i++)
                   if(charArray[i] < '0'     || charArray[i] > '9')
                        return;
                   super.insertString(offs, text, a);
    JTextfield textfield = new JTextField(10);
    textfield.setDocument(new NumericDocument());
    use this textfield object in ur application

  • How to control the line-in volume input via LabView?

    Anyone know how to control the line-in volume and balance input via LabView?

    I assume you are referring to audio line-in volume control and lerft-right balance...
    If so, then check out this thread:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000D83A0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Look at the info near the bottom from Paul S & Spectre. They talk about "winmm.dll"
    -cheers-
    JLV

  • How to pass the input control

    Hi, how to pass the input control from  1 report to another report please reply me ...

    HI Stefen,
    That feature is not yet provided .
    But you can achieve if you ahve that kind of requirement using the reportfilter summary options.
    please check if it can help you
    User input control for more than one tab in webI

  • How to change the input language ?

    Hello,
    I am writing an Add-on that needs to change the input language when the user
    clicks on the Item Code field ("5") in the "Item Master Data" form.
    I can perform the change when I am out side of the SAP application (for example if I create a Windows Form), however I cannot control the input language of the SAP itself through code.
    I even tried using Application.Sendkeys, however I was unable to send a combination of ALT+SHIFT, or at least it did not have any affect
    Here is the code on how to change the input language on a Windows Form:
    For Each Lng As system.Windows.Forms.InputLanguage In system.Windows.Forms.InputLanguage.InstalledInputLanguages
       sValue = Lng.Culture.DisplayName.ToUpper()
       If sValue.StartsWith("ENGLISH") Then
                        system.Windows.Forms.InputLanguage.CurrentInputLanguage = Lng
                        Exit For
        End If
    Next
    Any ideas ?

    I am not sure I understand the problem. Anyway in B1 you change the language by
    changing it from the Administration module. This raises a Application event that
    is sent to all the add-ons. The event is aet_LanguageChanged and you should
    then change the language handled by your add-on when you receive it.

  • Any ideas how to control the html color?

    I've never had to do this before- but I'm trying to change
    the background color of the html page that holds my master.swf on
    load of an external swf... I'm not even sure as to where to begin
    to look-- if anyone has any suggestions- that would be lovely...
    most of the google search results are just giving me flash 4
    tutorials on how to change a movie clips color... ughhh.
    Thanks!

    Powergroup,
    You may want to post a little bit more about your intended application.  I know a TCSC is a power electronic device used to vary the series impedance of power transmission lines by varying the delay angle of the thryistors in the device.  If the inputs for the delay angle for the TCSC need to be updated deterministicallyyou might want to look into using LabVIEW Real-Time Software and Hardware to control the inputs.
    However if project entails developing a feedback control scheme to vary the impedance of a transmission line using a TCSC based on a reference input you may be more interested in how LabVIEW would be able to develop the control scheme. I imagine you would want to take measurements to demonstrate the correctness of the TCSC controller based on this reference input which would also be a consideration.
    Please post a little more about your application as it may help determine how to go about controlling your TCSC.  Thanks.
    Bassett

  • How to control the data  in data selection

    Hi,
    how to control the data  .
    in the transfer structure I am having 10 fields and and the file which is to be loaded contains 7 fields only.where can I control  the other 3 fields and how .
    thanks in advance
    karna

    If your source file is flat file, add extra three fields with blank (just add field separator say comma for each extra field) and then load. It should be ok.
    Hope it helps..

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • How to control the measure based on the related dimension.

    Hi Experts,
    In order to improve performance, I have created three kinds of time tables in DB,such as Year .Month, Day.
    Then import them into the physical layer in RPD, and combine them into one dimension in BMM.
    Actually, it has three level fact related with three time tables,so they are also dragged into one fact in BMM,and one column will be corresponding with three column derived from different Fact table in physical layer.
    So I want to know how to control the measure based on the related dimension.
    For example:
    when users drag the Year,Sales column, it will come from Year Dimension and Year Fact Table.
    when users drag the Month,Sales column, it will come from Month Dimension and Month Fact Table.
    when users drag the Day,Sales column, it will come from Day Dimension and Day Fact Table.

    Hi,
    Create a dimension Hierarchy, with Year >> Month >> Day Levels and
    Next Double click on Year Table LTS >> click on Ocntetnt Tab >> set as Year
    same way for Month LTS and Day LTS.
    So now when you select year column then server canknow which LTS to hit and Hits Year LTS.
    Mark If Helpfu/correct
    Thanks.

  • How to control the size of live data in Coherence?

    How to control the size of live data in Coherence?
    See the following statement:
    Pause times increase as the amount of live data in the heap increases. We recommend not exceeding 70% live data in your heap. This includes primary data, backup data, indexes, and application data.
    --Excerpted from http://coherence.oracle.com/display/COH35UG/Best+Practices                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In any Java program, it is good practice to make sure your live objects leave some room in the heap for "scratch space." Without this, you will spend too much time in GC, and, in the worst cases, run out of memory. In the general case, you can see how much live data your application requires by looking at the heap used after a full GC's. For Coherence, you should ensure that live data, as you say, is under 70% of the maximum heap size.
    Coherence provides you tools to help enforce this policy. [http://coherence.oracle.com/display/COH35UG/local-scheme] describes how to size limit your cache. By implementing an eviction policy, you can control what happens when a size limit is exceeded.

  • In BSP how to give the input field as mandatory?

    Hi friends,
    In BSP how to give the input field as mandatory?
    In BSP i want to validate the input field (example checking the material no is valid or not)
    if this material no doesnot exit means i want to pass error message.What is the code for that.
    Moosa

    hi
    try this
    in LAYOUT
    <htmlb:inputField id = "vname"  disabled = "False" value = "<%= v_visitor %>"/> <font color="red" size="2"><b><%= page->messages->assert_message( 'vname' ) %></b></font></td>
    in DO_HANDLE_EVENT
    in oninputprocessing
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
        DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
        button_event ?= event.
      ENDIF.
        case event->id.
            when 'select'.
               if v_visitor = ''.
                 page->messages->add_message(
                 condition = 'vname'
                 message   = 'Visitor Name can not be blank'
                 severity  = page->messages->CO_SEVERITY_ERROR ).
              ELSE.
                    here u can write ur when ur field getting filled
            endif.
         endcase.
    endif.
    give marks if it is helpful
    thanks

  • How could control the scroll events in ALV OO?

    Hello experts!
    I'm programing a report, inside there is a field that need time of processing. I'm using ALV OO.
    I have thought that it could only calculate the field for the lines that visualize.
    How could control the scroll events to calculate the field of the visualized lines?
    I'm using CL_SALV_TABLE class and cl_salv_events_table to control the events, but there aren't any event to control the scroll.
    best regards!

    Hi Sriram,
    I did view the information that you was attaching, but this don't resolve my problem. With methods get_scroll_info_via_id and set_scroll_info_via_id, we can get and put information of selection and view rows in the screen but we don't control when the user click in the scroll for advance or to back down a page.
    I would like to refresh the data in ALV when the user view news rows.
    I want your genial ideas.
    Best regards!

  • How to change the input and output schema in BPEL process

    hi',
    Please tell me how to change the input and output schema in BPEL process after the process is made.
    thanks
    Yatan

    If your intention is just changing the content you are passing to bpel/returning from bpel
    Here is another way
    just update your default created xsd files with new elements, update wsdl elements in message definition and chnage bpel code to reflect new elements in activities
    Regards,
    Praveen

  • How to control the size of SVG images in epub files?

    There is unfortunately no support for SVG files in InDesign.
    Most of my images in jpg convertes nicely, but the small ones do not.
    Therefore I want to use SVG files which I have created in Illustrator.
    But how do I set the size in the epub file? Right now, whatever I do, they come out too big and I don't know how to control the size.
    Is there a program, like Sigil or other, that can place the image for me - I'm no html wizard you see....

    In any Java program, it is good practice to make sure your live objects leave some room in the heap for "scratch space." Without this, you will spend too much time in GC, and, in the worst cases, run out of memory. In the general case, you can see how much live data your application requires by looking at the heap used after a full GC's. For Coherence, you should ensure that live data, as you say, is under 70% of the maximum heap size.
    Coherence provides you tools to help enforce this policy. [http://coherence.oracle.com/display/COH35UG/local-scheme] describes how to size limit your cache. By implementing an eviction policy, you can control what happens when a size limit is exceeded.

Maybe you are looking for

  • Anyone recommend best iTunes release for user with no iPhone/iPod touch?

    After finally resolving some iPod restore issues - I am going to clean up my Windows install with a fresh install this weekend. Just wonder what folks think about always using the latest iTunes if one does not have an iPhone/iTouch etc. As I gathered

  • Call transaction and skip first screen

    Hi, I have a little but I think difficult problem I have a selection screen and after that I call my dnypro. In this dynpro I can open a dynpro which looks like a popup where I have the possibility to call the same transaction with other input paramt

  • How do I browse and listen to music samples in the iTunes Store on Apple TV 2

    I have an ATV2 and want to browse and listed to music samples in the iTunes Store as I did before, did this change or is there something that I need to setup to do this? Why do I not see this feature? Thanks

  • HTTP Proxy setting for SOA server

    Hi, my intention is to enable SOA Server to connect through HTTP Proxy to external services. This occurred when I am trying to connect to Yahoo Mail Server, via User Messaging Service but it keep throwing connection time out. One of the possible solu

  • Problem adding Remote multisite Entry Point

    Hi, we have DirectAccess 2012 setup for multisite with a default site with 2 DA servers with load balancing in Sweden, one DA server in Phoenix (US) and one in Romania. For the US one i had to change the entrypointDC after i had added it since otherw