How to create a single line textbox with up-down button?

Hello,
I mean for example is a text box for percentage. You can type in the value, or click the up or down button to get the value you desire. I tried attaching a small-sized vertical JScrollBar to a JTextField, but it is getting complicated that I need 2 different listeners(AdjustmentListener & FocusListener) for this.
If you have done this before, or maybe you have some suggestions, I would appreciate the help. These are some conditions that the percent text box needs:
- a click on up/down button increase/decrease the value by 1.
- the user types in a value more than 100 or less than 0 and press one of the button(up/down), setText to 100 or 0.
- the user types in a value in range, increase/decrease that value when up/down button is clicked.
Thank you for your time.

That's called a "spinner". I understand that it's a standard component in SDK 1.4, but I haven't looked at that myself, it's still in its beta stages. If you go to this page:
http://www.toedter.com/en/jcalendar.html
you will see an example (JSpinField), and you can download it for your own use.

Similar Messages

  • How to create a multiple-line TextBox in a jfx script?

    How to create a multiple-line TextBox in a jfx script?
    Or
    How to use the Swing component JTextArea in a jfx script?
    Please post a brief code segment.
    Thanks,
    Asghar

    This supports two way binding between JavaFX and Java and also cut and paste.
    Enjoy.
      * MyTextArea.fx
      * Created on Dec 14, 2008, 7:23:49 AM
    package twifxer.components;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.Font;
    import javafx.ext.swing.SwingComponent;
    import javax.swing.JComponent;
    import javax.swing.JTextArea;
    import java.awt.Color;
      * @author Steven Herod
    public class TweetTextComponent extends SwingComponent{
         var myComponent: JTextArea;
         public var length: Integer;
         public var readText:String;
         public var text: String on replace{
             myComponent.setText(text);
         public var toolTipText: String on replace{
             myComponent.setToolTipText(toolTipText);
         public override function createJComponent():JComponent{
             translateX = 15;
             translateY = 5;
             var f:Font = new Font("sanserif",Font.PLAIN, 11);
             myComponent = new JTextArea(4, 33);
             myComponent.setOpaque(false);
             myComponent.setFont(f);
             myComponent.setWrapStyleWord(true);
             myComponent.setLineWrap(true);
             myComponent.addKeyListener( KeyListener{
                 public override function
                 keyPressed(keyEvent:KeyEvent) {
                     if (keyEvent.VK_PASTE == keyEvent.getKeyCode())
                         myComponent.paste();
                 public override function
                 keyReleased( keyEvent:KeyEvent) {
                     var pos = myComponent.getCaretPosition();
                     text = myComponent.getText();
                     myComponent.setCaretPosition(pos);
                 public override function
                 keyTyped(keyEvent:KeyEvent) {
                     length = myComponent.getDocument().getLength();
             return myComponent;
    }

  • How to create 3 Fullscreen Undecorated JFrame with TextField and Button on

    I want to design a GUI which consists of Fullscreen Undecorated JFrame and It must be running like a kiosk
    So how to deal with as each Jframe will create a new object and it is impossible to manage the heap sapce

    harshal_2010 wrote:
    I want to design a GUI which consists of Fullscreen Undecorated JFrame Good for you, what have you done so far.
    and It must be running like a kiosksee reply #1
    So how to deal with as each Jframe will create a new object
    MyJFrame f = new JFrame("MyJFrame #1");
    and it is impossible to manage the heap sapceYes, you make sure you remove all references to your objects when you no longer need them and Java will do the rest with the GC.

  • Asset Creation in PR and PO and MIGO as a single Line item with "N" qty

    Hi All,
    In Purchase requestion ME51N
    Now we are creating "n" number of assets ( All are same item but "s.no" will vary) with "n" number of line item.
    Instead of this I have to enhance to create only one line item( For same item) with "n" quantity.
    for the ASSET account Assignment we have to create Asset(Temp no) for the each item/quantity(if the same item).
    as well as if they are going to create a PO with ref to PR they have to see all the "n" number of asset no.
    In MIGO creation for each asset we have to assign S.No and Asset Tag.
    How enhance the functionality in PR,PO and MIGO as well as in Invoice.
    Is it any User Exit/BADI is available for PR/POand MIGO to show all the "n" number of assets for a single line item.
    Kindly help me to give details to proceed further.
    Thanks in advance.
    sharma

    Hi Sharma,
    What i understand from your question is, you want to create a single line item in PR and PO. But the qty would be > 1.
    Each single qty would have its own asset number in account asssignment tab of item details of PR & PO.
    This is what you are expecting...Right???????????????
    Then this is possible with certain limitations.
    While creating PR, enter only one item with more qty.
    In item details section, in account assignment tab, on top left corner, there will be a button called Multiple account assignments.
    Click on it, then it looks like a table, where you can enter more than one line. (each line will have its own asset no)
    And choose option Distribute on qty basis for field Distribution.
    So that you can enter 1 qty for each line. ( Ex: if you created one line item in the item level with 10 qty, you need to maintain 10 line here, each qith 1 qty and diff asset no).
    The only limitation to this is, the GRN would be treated as non valueted. So when you make GRN there wwould not be any accounting doc. ( means no use of GR/IR clearing account as like normal for POs)
    when you prepare MIRO, all the assets will be capitalised and vendor credited.
    But in case if you receive partial invoice, then you have choose manually in MIRO. which asset is ot be capitalised.
    After entering the PO number in MIRO, there will be one line will be appeared with full qty. in the same line, move till the end of line, there you will have one button called Account assignments.
    Choose and go there, here you can choose which individual asset line to be considired.
    This will resolve your issue.
    Thanks,
    Srinu
    SRBORIGI_MULTIPLE ACCOUNT ASSIGNMENTS

  • How to create a single SCN [Inbound Deliery]  ' VL31n '   for multiple PO's

    How to create a single SCN [Inbound Deliery]  ' VL31n '   for multiple Purchase-Orders with the help of BAPI or BDC Recording in 4.6 b version.
    Manually its possible.. but how is it possible in the background i.e through BDC Recording or BAPI's.  
    [ As we donot have an option of creating one same  SCN [Inbound Deliery]  for multiple Purchase-Orders in 'VL31n' ].
    Please provide the needful Information.

    These mpeg2 clips do not have audio.
    I simply want to create a script that can read in the files, append to each other and then export to an .mov format.
    I want the process to be called from a command line that will open QT, run the script, read in the files, append and export.
    Thanks.
    G5 and Mac Pro Mac OS X (10.4.8) PC's and Windows
    G5 and Mac Pro Mac OS X (10.4.8) PC's and Windows

  • HELP! PDF objects - How to create a program line object?

    Hi Experts,
    I would like to know how to create a Program lines object (icon cog wheels). I need to create additional coding inside the context tab but when I try to right click on a folder --> create -->graphic,address,text,alternative...single record... No
    program lines can be created.
    Hope someone could help me.
    Thanks,
    Jeff

    There are two ways of doing it, depending on what you want to accomplish. Both require that you edit the file ~/.bashrc (I assume you use bash)
    1) If the application places all the executable files in a given directory (let's say /opt/Application/bin/), you can access all those executables directly by simply telling your shell where to look (in the same way the shell automatically looks for executable files in eg. /usr/bin). In ~/.bashrc, you would have to add a line that looks like this:
    PATH="$PATH:/opt/Application/bin"
    2) If you just want to make a traditional "shortcut" that executes a given command, this can be done with alias. Add this command to your ~/.bashrc:
    alias shortcut="some command"
    In this case, typing shortcut into a terminal will be interpreted just like if you had typed some command instead.
    In order to try out these changes, either restart your terminal or run this command:
    source ~/.bashrc
    [EDIT]
    I was obviously beaten to it
    Last edited by Peanut (2009-05-26 23:12:47)

  • How to create a muli line text area using JavaFx

    Hi all,
    Since the preview SDK does not contain TextArea any more, I am wondering how to create a muli line text area using JavaFX. The behaviour of this text area/field should be somehow similar to JTextArea in Swing or StyledTextWidget in SWT.
    Does JavaFX have any support for this? What would be a sensible approach to create such a widget?
    Thanks for your suggestions,
    br michael

    This is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
    You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
    Here's a simple example:
    Group {
       content: [
          TextBox {
             text: "This is a multi-line textbox"
             lines: 10  // <-- this may/may not be necessary depending on your situation. Default is 5.
             multiline: true
    }Edited by: loeschg on Jul 29, 2010 2:59 PM

  • How to create a single report using 5 difftent reports

    Hi Experts
    how to create a single report using 5 repors in it.
    Example
    I have to create a Survey history report using
    Reports like Surevy 1
                      Surevy 2
                      Surevy 3
                      Surevy 4
                      Surevy 5
    Please suggest me.
    Santosh

    Use Analysis Process Designer (RSANWB) to feed each of the survey BEX reports to one DSO.  Assuming each of the surveys has something in common to compare.  Could also be used as a snapshot storage for the surveys in case history needs to be compared/archived. 
    Build the Direct update DSO with the survey objects.  Add needed time characteristics and/or version control objects to the key. 
    Data sources  will be the 5 surveys. 
    Add formula to hardcode version/time for history.
    Data target is the direct update DSO.
    http://help.sap.com/saphelp_nw2004s/helpdata/EN/49/7e960481916448b20134d471d36a6b/frameset.htm
    -SM

  • How to create a multi-line table/column comment

    Can someone tell me how to create a multi-line table or column comment?
    Apparently, the concatenate operator (||) does not work with the COMMENT statement.
    I've searched the Oracle manuals and couldn't find an answer.
    COMMENT ON TABLE sometbl IS 'i would like to break up this comment into several lines in order to improve readability'; Effectively, this is what I'd like to do (but it doesn't work):
    COMMENT ON TABLE sometbl IS
      'i would like to break up ' || CHAR(10) ||
      'this comment into several lines ' || CHAR(10) ||
      'in order to improve readability' || CHAR(10); Oracle version is 10.2.0.4

    Why not just
    SQL> create table t (a int)
    Createtable successfully completed.
    SQL> comment on table t is 'i would like to break up 
    this comment into several lines 
    in order to improve readability'
    Commenton successfully completed.
    SQL> select * from user_tab_comments where table_name = 'T'
    TABLE_NAME           TABLE_TYPE  COMMENTS                               
    T                    TABLE       i would like to break up               
                                     this comment into several lines        
                                     in order to improve readability        
    1 row selected.?

  • How to create a single 'not null ' validation for all the items in a page ?

    Hi everyone ,
    how to create a single 'not null ' validation for all the items in a page ? I have many textfields . Instead of creating 'not null' validation for each item , I would like to create a a single validation control that will serve the purpose
    Thanks & Regards
    Umer

    Nice1 wrote:
    bob , as u said I have done the following :
    1) under create button , there are 9 items and for each item I have set Required to 'Yes'
    2) under delete button , there is 1 item and have set Required to 'Yes' for the item
    3) defined page validation for 9 items under 'create ' button and have set it to fire when 'create ' button clicked
    4) defined page validation for 1 item under 'delete ' button and have set it to fire when 'delete ' button clicked
    now , when I click 'create' button it even shows for the item under 'Delete ' button that it is a required itemSorry, I didn't see this note. The required template won't work, there is no way to attach it to the button.
    The best solution is as the reply a couple replies up
    Create 2 page type validations as a PL/SQL with code
    1st validation
    :P1_ITEM1 IS NOT NULL and :P1_ITEM2 IS NOT NULL ...... and :P1_ITEM9 IS NOT NULL  include all 9 items
    Set the When Button Pressed to the CREATE button
    2nd validation
    :P1_ITEM10 IS NOT NULL
    Set the When Button Pressed to the DELETE buttonI think that's going to be the easiest way to do it.
    Edited by: Bob37 on Apr 27, 2012 12:02 PM

  • How to create curve fitted line chart?

    Line chart is formed with straight lines, but how to create curve fitted line chart?

    Jasper wrote a blog on curve fitting charts

  • How to create burn folder for backup with 2 accounts

    The are 2 accounts on my computer: mine and my wife's. I want to create a single Burn Folder with important files from both accounts. How do I do that? Thanks,
    Owen

    Tri-Backup, (30-day Free Trial), can get you around all of this, for one thing it'll allow you to break it up into custom size chunks to span several CDs or DVDs, then Burn those...
    http://www.tri-edre.com/english/tribackup.html

  • How to create a stroked line that randomize each stroke color?

    Hi all, I am strating out designing in illustrator and I need help on how to created a stroked line, -----------, with each stroke (  -  )  a different colour, like, each stroke having a different randomized color which differs from the next one.
    Also, I need help on how to mask out parts of a template given to me by my school so i dont infringe that boundary when I add my lines to it. All helps appreciated, thank you.

    Ok thank you for your responses, Monika, I followed your instruction but it isnt working, is there any steps that I might have done wrongly? Here are some screenshots that depicts my problem:
    Here it is after I outline the stroke,
    And here it is when I apply the script:
    However, after I clicked okay, nothing changed and the strokes are still in their original color(yellow) as seen in the first picture. Did I do any steps wrong that result in this outcome? Also I've tried to put 99 instead of 99s and still, it didnt work.

  • How to create a custom function module with the records in SAP R/3?

    Hi All,
    How to create a custom function module with the records in SAP R/3? Using RFC Adapter I have to fetch the custom function module records.
    Regards
    Sara

    Hi
    goto se37...here u need to create a function group... then u need to create a function module. inside assign import/export parameters. assign tables/exceptions. activate the same. now write ur code within the function module
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
    Look at the below SAP HELP links, These links will show you the way to create a Function Module
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

  • How to create a new line in label in Xcode

    How to create a new line in label. for example I have two buttons & one label. when i press first button, l want to change the label text to "Hello World". then when I press the second button, on the same label I need to display"Good Bye" on the next line in xcode 5?
    I want to display the lablel like below:
    Hello World
    Good Bye

    I am using Xcode to develop an app for iOS.
    I tried using multi-line label & belwo is my code.
    - (IBAction)change:(UIButton *)sender {
        self.Screen.text = @"\nHello World";
    - (IBAction)newChange:(UIButton *)sender {
          self.Screen.text = @"\nGood bye";
    everytime when i pressed the button, it replacing the whold lable text instead of adding the second line.

Maybe you are looking for

  • Upgrade from R/3 4.7 to ECC 5.0

    Hello Everyone This is my very first post on SDN. I am going to do an upgrade from R/3 4.7 to ECC 5.0. Can anyone please tell me how do I start and procede, this will be my very first upgrade and I definitely need help!!!. I will be really thankful i

  • How to fetch Junk values and its columns dynamically

    Hello, Can anyone help me in writing a procedure/dynamic SQL to fetch the column where the junk values appears and its value. Eg: If emp table contains ID and Name columns, and ID column contains junk values, the result should be the Id column and th

  • Printing duplex for script

    hi, i face problem of printing my PO in duplex mode, i have set the print mode in script as duplex, by it still doesnt come out in duplex. i have tested with SAP standard text :SAPSCRIPT-PRINTMODETEST and it shows correctly that the printer works for

  • This entry already exists in the following tables 'Deposit' (ODPS)(ODBC -02

    My client gets this message when she tries to do a deposit.  She was fine up until 2/13 and this week, this has started to happen.  Any suggestions that I can look for This entry already exists in the following tables 'Deposit' (ODPS)(ODBC -2035) [Me

  • Choosing the proper port when creating email accounts.

    Comcast wants us to use 587. But that created some problems for me. Mail prefers 995. My email boxes were always offline and refused to go online when I am using 587 but 995 they love it. Do I have to open port 587 somewhere? Thanks in advance.