How to create Using Formatted Text Field with multiple Sliders?

Hi i found the Java Sun tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html very useful, and it tells how to create one Formatted Text Field with a Slider - however i need to create Formatted Text Field for multiple Sliders in one GUI, how do i do this?
my code now is as follows, and the way it is now is scroll first slider is okay but scrolling second slider also changes value of text field of first slider! homework due tomorrow, please kindly help!
// constructor
label1 = new JLabel( "Individuals" );
scroller1 = new JSlider( SwingConstants.HORIZONTAL,     0, 100, 10 );
scroller1.setMajorTickSpacing( 10 );
scroller1.setMinorTickSpacing( 1 );
scroller1.setPaintTicks( true );
scroller1.setPaintLabels( true );
scroller1.addChangeListener(this);
java.text.NumberFormat numberFormat = java.text.NumberFormat.getIntegerInstance();
NumberFormatter formatter = new NumberFormatter(numberFormat);
        formatter.setMinimum(new Integer(0));
        formatter.setMaximum(new Integer(100));
textField1 = new JFormattedTextField(formatter);
textField1.setValue(new Integer(10)); //FPS_INIT
textField1.setColumns(1); //get some space
textField1.addPropertyChangeListener(this);
//React when the user presses Enter.
textField1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),  "check");
        textField1.getActionMap().put("check", new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                if (!textField1.isEditValid()) { //The text is invalid.
                    Toolkit.getDefaultToolkit().beep();
                    textField1.selectAll();
                } else try {                    //The text is valid,
                    textField1.commitEdit();     //so use it.
                } catch (java.text.ParseException exc) { }
label2 = new JLabel( "Precision" );
scroller2 = new JSlider( SwingConstants.HORIZONTAL, 0, 100, 8 );
scroller2.setMajorTickSpacing( 10 );
scroller2.setMinorTickSpacing( 1 );
scroller2.setPaintTicks( true );
scroller2.setPaintLabels( true );
scroller2.addChangeListener(this);
textField2 = new JFormattedTextField(formatter);
textField2.setValue(new Integer(10)); //FPS_INIT
textField2.setColumns(1); //get some space
textField2.addPropertyChangeListener(this);
//React when the user presses Enter.
textField2.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),  "check");
        textField2.getActionMap().put("check", new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                if (!textField2.isEditValid()) { //The text is invalid.
                    Toolkit.getDefaultToolkit().beep();
                    textField2.selectAll();
                } else try {                    //The text is valid,
                    textField2.commitEdit();     //so use it.
                } catch (java.text.ParseException exc) { }
// State Changed
     public void stateChanged(ChangeEvent e) {
         JSlider source = (JSlider)e.getSource();
         int fps = (int)source.getValue();
         if (!source.getValueIsAdjusting()) { //done adjusting
              if(source==scroller1)   {
                   System.out.println("source ==scoller1\n");
                   textField1.setValue(new Integer(fps)); //update ftf value
              else if(source==scroller2)     {
                   System.out.println("source ==scoller2\n");
                   textField2.setValue(new Integer(fps)); //update ftf value
         } else { //value is adjusting; just set the text
             if(source==scroller1)     textField1.setText(String.valueOf(fps));
             else if(source==scroller2)     textField2.setText(String.valueOf(fps));
// Property Change
    public void propertyChange(PropertyChangeEvent e) {
        if ("value".equals(e.getPropertyName())) {
            Number value = (Number)e.getNewValue();
            if (scroller1 != null && value != null) {
                scroller1.setValue(value.intValue());
             else if (scroller2 != null && value != null) {
                scroller2.setValue(value.intValue());
    // ACTION PERFORMED
    public void actionPerformed(ActionEvent event) {
    if (!textField1.isEditValid()) { //The text is invalid.
        Toolkit.getDefaultToolkit().beep();
        textField1.selectAll();
    } else try {                    //The text is valid,
        textField1.commitEdit();     //so use it.
    } catch (java.text.ParseException exc) { }
         if (!textField2.isEditValid()) { //The text is invalid.
        Toolkit.getDefaultToolkit().beep();
        textField2.selectAll();
    } else try {                    //The text is valid,
        textField2.commitEdit();     //so use it.
    } catch (java.text.ParseException exc) { }
...

if :p3_note_id is null
then
insert into notes (project_id, note, notes_month, notes_year) So, p3_note_id is NULL.
Another option is that you have a trigger on table NOTES that generates a new note_id even for an update.

Similar Messages

  • Livecycle populate text field with multiple records from list box

    Can someone tell me how can I populate a text field from list box when I have multiple select.
    Here is example:
    List box consist: Hello
                             World.
    I want to see this in text field: Hello,World.
    Thanks!

    Hi Legro
    I don't know if I understand you correctly, but you can do something like this:
    ----------------- java script begin ---------------------------------
    //Reset text field
    TextField.rawValue = "";
    //loop through items in listbox
    for(i = 0; i < ListBox.length; i++)
              //if item selected
              if(ListBox.getItemState(i))
                        //check if Text field value if null
                        if (TextField.isNull)
                                  TextField.rawValue = ListBox.getDisplayItem(i);
                        else
                                  TextField.rawValue = TextField.rawValue + " " + ListBox.getDisplayItem(i);
    ----------------- java script end ---------------------------------
    I have attached an sample PDF so that you can see how it works!!
    Kind Regards
    Søren Høy Nielsen Dafolo A/S

  • How to create PDF from text file with specific layout?

    I wanted to create the pdf from text file in specific layout - Landscape orientation and JIS B3 Page size while at Adobe Acrobat Pro.
    In past, I could do a right click on a text file (desktop area) and select print to print out the document into .pdf BUT only if I set the Adobe PDF to Landscape and JIS B3 Page size BEFORE.  And I could only do 15 text documents at once.
    I wanted to see if I could do the create the pdf from text file with specific layout in Adobe Acrobat without having to go to Control Panel to preset the Adobe PDF to specific layout at every time.   I would have to set Adobe PDF back to normal layout after I'm done with these pdf print outs.  I do lots of pdfs in normal layout.  Sometimes I would forget to do that.
    So, How do I do that?

    No such luck.  It would output the contents in letter size even in JIS B3 Page layout at MS word. 
    Is there a script or action where I could set the orientation and page size before creating PDF on these text files?

  • How to set "Display as Text" field with AJAX select list

    thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
    http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
    here is the code from the url above
    1. Create an Application Process - getDet:
    DECLARE
    my_det VARCHAR2 (200);
    BEGIN
    SELECT ename || CHR(10) || job || CHR(10) || mgr
    INTO my_det
    FROM emp
    WHERE empno = :P80_EMPLOYEES;
    HTP.prn (my_det);
    END;
    2. Put the following in the Region Header of your page:
    <script language="JavaScript" type="text/javascript">
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P80_DETAILS').value = gReturn  }
    else
    {  html_GetElement('P80_DETAILS').value = 'null'  }
    get = null;
    </script>
    3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
    onChange="f_getDet()";

    Arie,
    this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
    Thanks,
    Surya
    <script language="JavaScript" type="text/javascript">
    function setDisplayOnlyNode(pItem, pValue)
    { var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    { setDisplayOnlyNode('P1_DETAILS',gReturn)}
    {  html_GetElement('P1_TEST').value = gReturn  }
    get = null;
    </script>

  • How do you sort a text field with numeric data in numeric order

    We have a text field (varchar2) that has numeric data. When we sort it the items display as
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    *101*
    12
    Instead of
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    12
    101
    How can I make it display in numeric order if the field is a varchar2
    Howard

    To avoid string-to-number conversion:
    SQL> with t as (
      2  select '1' a from dual union
      3  select '2' a from dual union
      4  select '3' a from dual union
      5  select '4' a from dual union
      6  select '5' a from dual union
      7  select '6' a from dual union
      8  select '7' a from dual union
      9  select '8' a from dual union
    10  select '9' a from dual union
    11  select '10' a from dual union
    12  select '101' a from dual union
    13  select '12' a from dual)
    14  select a from t
    15  order by length(a), a;
    A
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    12
    101
    12 rows selected.Max
    http://oracleitalia.wordpress.com

  • Text Field with multiple lines

    I am trying to create a text field in the selection screen where it can insert a text with multiple lines for instance those text fields which you can see online where you can key in text lines after lines.
    How do you do that in ABAP?

    Hi
    See any Std program code for CREATING long Text lines
    See any application document HEADER or ITEM text and copy that code
    first declare a field with some table field
    like
    PARAMETERS: p_text like Tline-tdname.
    then keep a button (for Long text) and in the program write a code such that when you press on that line it will take you to text ediotr
    using the CREATE_TEXT fun module
    copy it from a std program text..
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to create a blu-ray disc with multiple source files

    Hello,
    How is it possible to create a blu-ray disc, AVCHD recordable DVD with multiple source files from Final Cut Pro 10. Is it possible to create a menu with several chapters corresponding to the sequences (source files)?
    Thank you in advance for your support.

    Assume you're talking about using the Create Blu-Ray batch template. It's not possible to do with multiple source filles. But if I understand your objectives, you could pretty much get what you think want – discrete movie segments on a single disk with navigation.
    The way I'd approach it is by making multiple projects in FCP and then copying the finished versions into a new project, separated by gaps. (You could also use compound clips but I'm not a fan except for very short sequences, which is why I'm suggesting the copy route.) Then export and bring into Compressor.
    In Compressor mark your chapters at the gaps between your individual sequences. Then choose the AVCHD option in job actions.
    Bear in mind that you'll have to keep the recording time under roughly 30-35 minutes @a5 Mbts/sec
    Good luck.
    Russ

  • How to Create one TLB Order manually with multiple deployed STR's

    Hello,
    We are currently facing an issue when trying to make a TLB manually by right clicking on the deployed STR's.
    APO generates multiple orders for each item.
    Business requirement is to generate one TLB Order.   
    For example there are 10 Confirmed STR's and the  planner wants to choose the deployed STR's manually from the list of 10 products.   When we right cliick and select each product (for either partial or full ) it moves to the TLB order, but generates multiple orders.
    Is there a way to restrict the requested lines to be in one Order?  So that when the order is CIFed to ECC, there's only one STO generated with multiple lines.
    Regards,
    Bhavesh

    Hi Bhavesh,
                   By manual TLB process only you can create stock transfer order with SINGLE line item. because your deployed STRs always will have single line item and you are selection one by one and converting manually. in STD process you can not club items manually...
    Yes it can be very much possible by automatic TLB run. it will take all the deployed orders and converting as TLB order by considering TLB profile where min , max limits maintained. also there is concept if you maintain loading group in product master based on that materials will be grouped together.....
    Clubbing items into one order is done by TLB heuristics.. but when you do manually you are deciding how to do it?....
    You can do one thing... after creation of TLB order with single item..you can edit and include some more items manually. Accordingly you need to delete deployed STRs.......
    If you want to automate this then you need to look out for BADI... not sure possible or not
    Regards
    Thennarasu.M

  • How to create a movie for iPhone with multiple Subtitles?

    Hey there,
    I'd like to watch some of my DVDs on my iphone to learn englisch. Therefore I'd like to be able to switch between German and englisch subtitles and of course have a german and englisch audio. is that possible?

    hello,
    it is not officially supported. however, it can be done when you write your own makefile. how to call the compiler and necessary flags and so on see the "build results" output of xcode. it's like
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -x objective-c -arch i386
    and so on. after you created the object files you create the library with the archive tool, like
    ar -crv libwhatever.a Dada.o Bubu.o AnotherOne.o
    regards,
    sebastian mecklenburg

  • How do I use one iTunes account with multiple macs?

    I have a Mac mini and am getting a MacBook Pro.  I want to use my iTunes library that currently resides on my mini on my MacBook as well without jacking up anything.
    I have an iPhone, an iPad Air and a classic iPod that are all sync'ed to the iTunes on the mini.

    Hello blcampbell
    There are many different ways to handle this and the easiest way is to migrate you data is to use Migration Assistant. It will migrate not only your music but also other content from your Mac Mini. If all you want is music, you can always just select that as an option. The article below will guide you through that option plus a few others if you are unsure how you want to proceed.
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Regards,
    -Norm G.

  • How to create schema to enable work with multiple users during developmet

    Hi,
    My goal is to enable all developers in the team to work on the same database and schema name installed on some server in the company but each developer will have a "personal" instance of the schema (so changes made to the database will not harm the other developers) and the connection to the schema will possibly made through different port (1521, 1522, 1523 etc). This kind of work is needed on developing time and possibly for the QA team. The oracle server is installed on some server and client installation can be installed (if needed) on each developer machine.
    What do i need to do in order to achieve this goal (if it possible at all) ?
    I am using Oracle 9.2
    Thanks a LOT for any help.
    simon.
    Message was edited by:
    user488209

    > Oracle and JBoss and Hibernate which is my
    persistence layer so Pl/SQL is not needed (right?)
    Simon, I would have taken a virtual lead pipe to you if you worked in our dev shop and made that statement. :-)
    Data persistance layers in the middle tier are fundementally flawed.
    Why? Because they attempt to do what the database is already doing. The database's core function is data persistance, data integrity, data processing.
    It does this better than any other piece of software in the architecture. If not, then why use a database tier (usually the most expensive one) anyway? What are the benefits? Why not simply persist the data in the middle tier and use file-based (not database-based) storage mechanism?
    Simple example. An employee object persist in the middle tier. Performance becomes a problem. JBOSS and other app server s/w scaled by adding more h/w. So now you have that employee object persisting as copies across several app platforms.
    One of the fundemental relational principles of dealing with a single copy of data is violated. Multiple copies exist. They need to be kept in sync'ed. Locking needs to be handled in a distributed fashion. And what happens when a batch process on the database, oblivious to the persistant copies in the app tier, changes that employee's data?
    Guess what.. the database does all this for you. Locking. Data integrity. Scalability. Etc.
    AND IT DOES IT BETTER THAN WHAT THE APP TIER CAN!
    So to answer your question. I write entire applications and systems in PL/SQL. Yes, PL/SQL is a capable language. Yes, anything you can do in Java (as far as data processing goes), PL/SQL does better and faster with more inherant scalability - with less development time. Fact and not opinion.
    Oracle has in excess of a million lines of PL/SQL source code for the Oracle Applications product suite. So PL/SQL is a "serious" language.. not something that is simply used for the odd thing.
    Performance wise? Oracle Replication is entirely written in PL/SQL - and not in something like C/C++ (which usually also outperforms Java).
    90% of all the code that we write, is PL/SQL. The remainder is Java (JBOSS) and Perl with some Pro*C legacy stuff (most of which is rewritten as PL/SQL). In fact, I think the guys now write more Perl code than Java (doing processing that needs to be done totally outside Oracle). And JBOSS is an integrated architecture that we're using... (we even have a JBOSS cluster with a Linux Virtual Server/Director as gateway)
    Not using PL/SQL? That will be a critical mistake. (I suggest that you visit http://asktom.oracle.com for more details on PL/SQL, Java, application tiers and database tiers).

  • How Can I Use a Gmail Account with Multiple Email Addresses in iPhone Mail?

    So I have a Gmail account with 4 POP accounts that it checks...  Is there a way to get "Reply From" from multiple addresses?
    I've tried the following sites...  No luck with iOS 5...
    http://email.about.com/od/iphonemailtips/qt/gmail_multiaddr.htm
    http://modernerd.com/post/535350679/solved-gmail-ipad-iphone-and-multiple-from

    By setting up your GMail account to forward emails to your iCloud email account address.
    You won't be able to reply from your Gmail address from within iCloud though.

  • How to make a Input Field with multiple lines?

    hey folks,
    i need to make a popup window or a dynpro with 2 input fields, where the user can write on multiple lines. why isnt there such an input field in the screen painter? how can i make this? if i can do this with a dynpro it would be nice but a popup with that feature would be better. didnt found any infos anywhere except for that thread, but its answer didnt work with my dynpro:
    How to make a input/output field with multiple lines
    thx for any helping answer

    i made it just like in that thread but there is an error message telling that gv_custom_container is not declared.
    *  MODULE status_0110 OUTPUT
    MODULE status_0110 OUTPUT.
      CREATE OBJECT custom_container
        EXPORTING
          container_name              = 'TEXT_CONTROL'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5.
      CREATE OBJECT text_editor
        EXPORTING
          parent                     = gv_custom_container
          wordwrap_mode              = cl_gui_textedit=>wordwrap_at_windowborder
          wordwrap_to_linebreak_mode = cl_gui_textedit=>false
        EXCEPTIONS
          error_cntl_create          = 1
          error_cntl_init            = 2
          error_cntl_link            = 3
          error_dp_create            = 4
          gui_type_not_supported     = 5.
      SET PF-STATUS 'STATUS_0110'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                    "status_0110 OUTPUT
    Edited by: rafe b. on Oct 26, 2009 2:56 PM

  • How to make an editable bulleted list with multiple lines and custom bullets?

    How do I create an editable bulleted list in Acrobat Pro? I've figured out how to add text fields with multiple lines, and how to add a list box, but I don't see the check box for multiple lines in the list box or how to add bullet points. Can someone please give me step by step instructions? Also is it possible to use custom bullet points?

    Is it a text field or a list box field? The two are not the same...
    The bullets are something that the user will have to enter manually (into a text field, they can only select values in a list-box).
    They can use any unicode character, or special characters if the font used for that field allows for it. You can't use images for the bullets, if that's what you mean.

  • How to create a pdf/a-1b with a text field

    hello, I'm trying to execute a very simple task: create a pdf/a-1b containig a text field.
    using Acrobat XI pro, I created a simple pdf form with 1 form field of type text , then tried to save as pdf/A-1b. The pdf is saved but the form field is removed from resulting pdf.
    Here in detail the steps I made:
    0) configure adobe pdf printer to save as pdf/A-1b
    1) creat a test.txt with notepad
    2) print using acrobat pdf printer
    3) open the generated pdf with Acrobat XI
    4) in 'Standards' panel I see that pdf conform
    5) now go to 'Tools\Modules' and 'Modify'
    6) add a textbox field
    7) exit from 'Modify' mode and save
    8) in 'Standards' panel I see that pdf doesn't conform.
    9) I opened the preflight tool and see two errors
         a) "XMP property for a page object not predefined and no extension schema present".
         page reports the following Trigger values:
         - Extension schema is present in XMP: is not true
         - Property exists in PDF/A Standard: is not true
         b) Form field does not have an appearance dictionary
         page reports the following Trigger values:
         - Form field has an appearance dictionary: is not true
    I'm quite new to Acrobat: simply downloaded the Actobat XI evaluation version, created the file and added the text field. No special settings nor other configurations was applied,
    I'm wondering if someone else was able to reproduce this behavior.
    thank you for any comment

    First, about invalidating the PDF/A. I was told, but never had this confirmed nor tested, that editing a PDF/A will automatically cause the PDF/A status to be deleted from the file. This is because Acrobat does not know about the compatibility of every edit with every current (and future) PDF subset standard, so it is safest just to remove the indicator - if you turn off Adobe's PDF/A view mode which will prevent editing anyway.
    Now, you have a problem with the signatures. Possibly a very big one. Your description "2) fill the text field with some annotations and then sign the signature field 3) save the pdf" is a little too separated. At the time a file is signed it is saved, the hash calculated, and written to the file. So signing and saving are just one action. Yet an unsigned digital signature needs, it seems to me, no appearance.
    I think the solution is a simple one. Sign it, but not with a signature field. If it is PDF/A when you start it is probably PDF/A when you finish. Signature fields seem a distraction and obstacle to the important thing, signing.

Maybe you are looking for