Scrolling a textpane with pgup key.

Well, i want to add so that the user can scroll up 1 page in a jtextpane lying in a jscrollpane by pressing the page up key.
Been looking around how to do this, but havent found anything so far...
Can anyone give some suggestions?

Not sure I understand this question. This is the default behaviour of the text pane when it has focus.
Well, I have never tried this but the JViewport has a couple of methods for scrolling:
1) scrollRectToVisible(...)
2) setViewPosition(...)
There is also a method getViewSize(). The getViewSize returns a Rectangle which contains the x,y and width height values.
So, you could just add/subtract the height of the current position to get a new view position and then uses of the above methods to do the scrolling.
Or, JTextPane implements the Scrollable interface which contains a method, getScrollableBlockIncrement(...) which could be used to calculate a new position.
Or, JScrollBar has a getBlockIncrement(...) method. It also has getValue(), setValue(...) methods. So maybe something like:
JScrollBar bar = scrollpane.getVerticalScrollBar();
bar.setValue( bar.getValue() + bar.getBlockIncrement(...) );

Similar Messages

  • Screen Scrolls in games with arrow keys

    My kids play a lot of games online.  I can't lock the screen or whatever you want to call it.  If the game requires the arrow keys to move the character, it scrolls the screen until they can't see the game.  I have tried to click on the flash player game window but it still scrolls to the bottom of the page when you pich the arrow keys.  Any help?  Thanks!

    What is "it"? Did you create the game in Flash, or is this an online game?

  • Since Mavericks, the scroll-with-modifier-key-to-zoom functionality often fails, and I have to deselect it and reselect it in the accessibility pref-pane to get it working again.

    Since Mavericks, the scroll-with-modifier-key-to-zoom functionality often fails, and I have to deselect it and reselect it in the accessibility pref-pane to get it working again.

    Take it to your local Apple Store or AASP, it's covered by a 1 year hardware warranty. If you have AppleCare then give them a call but I'm pretty sure they will advise the same. If you have not purchased AppleCare yet please do, this will extend the warranty to 3 years however it MUST be purchased within the first  year of ownership. Let it go 366 days and you are out of luck. AppleCare will also include telephone support too.
    Good luck.

  • JBO-25014: Another user has changed the row with primary key...

    Hello,
    could you help me please with resolving this error "JBO-25014: Another user has changed the row with primary key..." - I am just getting a row from a view by bind "filter" variable, then I am assigning new values for some of the attributes - and trying to commit ..unsuccessfully..
    View is based on Entity.
    I saw directive for setting Entity's attributes as "update after insert / update" - but this did not help me.
    Thanks in advance.

    Hi
    Please try this solutions:
    One solution is to change the ADF BC locking behavior to optimistic instead of pessimistic. Choose the AM and click the Configuration context menu option. Select the LocalAM entry and go to the Properties. Scroll down to the locking setting and change the existing entry
    If there is a trigger changing values, you need to mark those attributes (the ones that may be changed) as refresh after insert and/or refresh after update in your Entity Object.

  • T410: How to turn on thinklight without use pgup key

    Dear all!
    I am using Thinkpad T410, my keyboard is broken a key as "Pgup". Now when I want to turn on off the Thinklight, I can't use FN+Pgup. I think there is some other ways to turn on off the Thinklight without Pgup key.
    Please help me for this case!
    Thanks a lot!

    As far as I know there is no current Windows software utility to control the ThinkLight.
    This earlier thread may provide some insights, ThinkLight - programmatic control as may this Python script for Windows to control ThinkPad features.
    Note however that the software and scripts mentioned in them do not work with current Windows versions.
    Cheers... Dorian Hausman
    X1C2, TPT2, T430s, SL500, X61s, T60p, A21p, 770, 760ED... 5160, 5150... S360/30

  • How do I turn on long press keyboard to write the same character many times with one keystroke only? I can only write 1 letter at a time with each key press. To write "aaaaa" I need to press 5 times the A key. I didn't use to do this.

    I know this has something to do with INSERT key in Windows I guess. But suddenly I was using Mac OS X Lion and a keyboard sign appeared in the top bar, and the keyboard didnt work as it usually does. I mean, I wanted the long press key to write multiple caracters of course. Please help!

    It's now a hidden option that can be turned on with a terminal command.  The easiest way to do this is to download TinkerTool from this site:
    http://www.bresink.com/osx/0TinkerTool/download.php5
    Then go to Tinkertool > General tab > Select "support key repeat".
    Logoff and login again.
    Regards,
    Captfred

  • Issue in Data from DSO to DSO Target with different Key

    Hello All,
    I am having Issue in Data from DSO to DSO Target with different Key
    Source DSO has Employee + Wage + Post numner as key and Target has Employee + Wage Type as key.
    DSO semantic grouping works like Group By clause in sql, is my understanding right ?
    Also if someone can explain this with a small example, it would be great.
    Many Thanks
    Krishna

    Dear, as explained earlier your issue has nothing to do with semantic grouping .
    Semantic grouping is only usefull when you have written a routine in the transformation for calculations and in error handling .
    Please go through this blog which explains very clearly the use of semantic grouping .
    http://scn.sap.com/community/data-warehousing/netweaver-bw/blog/2013/06/16/semantic-groups-in-dtp
    Now coming to your above question
    DSO 1
    Employee WageTyp Amount
    100          aa          200
    200          aa          200
    100          bb          400
    100          cc          300
    If we have semantic group as Employee .   If we have Employee as key of the target DSO and update type as summation .
    then target DSO will have
    Emp                Amount
    100                 700
    200                 200
    In this case Wage type will be the last record arriving from the data package . If the record 100  cc  300 is arrivng last then wage type will be cc .
    2) Case 2
    DSO 1
    Employee WageTyp Amount
    100          aa          200
    200          aa          200
    100          bb          400
    100          aa          300
    if we do Semantic grouping with Emp and Wage Type   If we have Employee and wage type as key of the target DSO and update type as summation .
    then target DSO will have
    Emp     Wage      Amount
    100          aa          500
    200          aa          200
    100          bb          400
    Hope this helps .

  • Crystal Report with Compound Key

    Hi,
    I have Characteristic with Compound Key in SAP BW 7.0. This Characteristic use to store the Purchase Order Item Line. The Compound Key is the Purchase Order Document.
    So I will have the following fields created for this Characteristic:
    Compound Key (Purchase Order Document) 5600001982, Purchase Order Item Line 10
    I created a Query for this Characteristic and I have the following as result:
    10 ...
    20 ...
    30 ...
    All works fine.
    Now I created the Crystal Report from this Query. When I display this Characteristic in Crystal Report, I have the following:
    5600001982/10
    5600001982/20
    5600001982/30
    Is this a bug or Crystal not support the Compound Key?
    Please advise, thank you.

    Hello,
    Did you get this resolved.
    Were you able to display characteristics in Crystal without the compounding characteristic.
    Thanks.

  • Crystal Report and InfoObject with Compound Key

    Hi,
    I have Characteristic with Compound Key in SAP BW 7.0. This Characteristic use to store the Purchase Order Item Line. The Compound Key is the Purchase Order Document.
    So I will have the following fields created for this Characteristic:
    Compound Key (Purchase Order Document) 5600001982, Purchase Order Item Line 10
    I created a Query for this Characteristic and I have the following as result:
    10 ...
    20 ...
    30 ...
    All works fine.
    Now I created the Crystal Report from this Query. When I display this Characteristic in Crystal Report, I have the following:
    5600001982/10
    5600001982/20
    5600001982/30
    Is this a bug or Crystal not support the Compound Key?
    Please advise, thank you.

    a

  • Scrolling and rightclicking with magic mouse doesnt  work anymore

    Suddenly scrolling and rightclicking with magic mouse doesnt work any more. Left clicking and cursor moving works normal. I have checked the system preferences for the mouse and find nothing strange or unchecked. Any ideas?

    Also tried the universal access thing. Doesnt work.

  • BEX - Get Open Items with a key Date

    Hi Gurus,
    Im working with the Cube and ODS for AR Line items (0FIAR_C03- 0FIAR_O03) and i need to create a report that shows the Open items by Customer with a Key Date.
    I did the query that shows all the open items by customer, and i want to know where can i put the filter to input a key date, and only shows the open items until that date.
    Thanks in advanced, i really appreciate your help

    Hi Marcos,
    When you have created the Restricted keyfigures for Open Items, You have to add the date characteristic on which you are looking open item and add the variable there.Here you have to use a variable of type Interval and select the operator "<" the date of the Variable.If you go through, there are standard variable for keydate, which you can use directly.
    Hope you got the idea
    Regards
    Happy Tony

  • How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys?

    How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys an see at the same time the changes on the photo?
    It worked under Windows, now I use OS 10.8 and have to apply a preset with a click or Return button but after that the pop-up menu close so I have to open it once again to change a preset. Please help. Thank you!

    The filter panel is a shortcut for the content panel and it only effects the content of that window. So if you have a folder it will only see this as a folder and not with its content. (a Stack behaves about the same, being different in only counting the first file in the filter panel criteria but not what is in the stack itself)
    You have a view work arounds, first is use menu view / show items from subfolders (this can take some time especially if you have not used caching before on this content) and this builds visible thumbs for all content and that can be used for filtering.
    Or use the find command (Edit / find) and inhere specify the source and fill in the criteria include subfolders and this will give you the correct result.
    When you create a smart collection the find command also pops up given you the same opportunity to get the results in a collection, but since a collection is only a bunch of aliases referring to the originals you might be a bit careful with editing and deleting.

  • I need help with Creating Key Pairs

    Hello,
    I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
    the class is :
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import au.net.aba.crypto.provider.ABAProvider;
    class CreateKeyPairs {
    private static KeyPair keyPair;
    private static KeyPairGenerator pairGenerator;
    private static PrivateKey privateKey;
    private static PublicKey publicKey;
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
    return;
    createKeys();
    saveKey(args[0],publicKey);
    saveKey(args[1],privateKey);
    private static void createKeys() throws Exception {
    Security.addProvider(new ABAProvider());
    pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
    pairGenerator.initialize(1024, new SecureRandom());
    keyPair = pairGenerator.generateKeyPair();
    privateKey = keyPair.getPrivate();
    publicKey = keyPair.getPublic();
    private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    the public key is:
    �� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�|  xpt Javaur [Ljava.lang.String;��V��{G  xp   q ~ ur [B���T�  xp   ��ccR}o���[!#I����lo������
    ����^"`8�|���Z>������&
    d ����"B��
    ^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
    How i can generated the key pairs in base 64 or binary????
    Thanxs for help me
    Luis Navarro Nu�ez
    Santiago.
    Chile.
    South America.

    I don't use ABA but BouncyCastle
    this could help you :
    try
    java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
    java.security.KeyPair kp = kg.generateKeyPair();
    java.security.Key pub = kp.getPublic();
    java.security.Key pri = kp.getPrivate();
    System.out.println("pub: " + pub);
    System.out.println("pri: " + pri);
    byte[] pub_e = pub.getEncoded();
    byte[] pri_e = pri.getEncoded();
    java.io.PrintWriter o;
    java.io.DataInputStream i;
    java.io.File f;
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
    o.println(new sun.misc.BASE64Encoder().encode(pub_e));
    o.close();
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
    o.println(new sun.misc.BASE64Encoder().encode(pri_e));
    o.close();
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
    StringBuffer keyBase64 = new StringBuffer();
    String line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
    keyBase64 = new StringBuffer();
    line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
    java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
    System.out.println("pub: " + pubKey);
    java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
    System.out.println("pri: " + priKey);
    catch(Exception e)
    e.printStackTrace ();
    }

  • Maintenance View for custom table with foreign key relationship

    Hi Folks,
         I have created a custom table with foreign key relationship with other check tables. I want to create a maintenance view / tablemaintenance generator. What all things I need to take care for the foreign keys related fields while creating the maintenance view / tablemaintenance generator.
    Regards,
      santosh

    Hi,
    You do not have to do anything explicitely for the foreign key relationships in the table maintainance generator.
    Create the table maintainance generator via SE11 and it will take care of all teh foreign key checks by itself.
    Regards,
    Ankur Parab

  • Has anyone figured out how to get speech recognition working with sticky keys enabled on mountain lion?

    I'm trying to use speech recognition to input text on my iMac running the latest mountain lion, 10.8.3.
    I have sticky keys enabled.
    When I try to start speaking by pressing the function key twice nothing happens. I can only get it to work if I disable sticky keys.
    The same problem occurs with all the other modifier keys as shortcut, they do not work with sticky keys.
    When I try to select a different shortcut, I am unable to select a two key combination, but am limited to one.
    If I select the F6 key, or any other single key, I am able to start speech recognition. However the second time that I press the key, it does not stop recognition and process my words. Instead, it restarts the recognition.
    Has anyone figured out how to get speech recognition working with sticky keys enabled?
    Or a way to get an individual key shortcut to start on the first press and process it on the second?
    Or a way to get key combinations to work, as specified by the help:
    Dictation On and Off
    To use Dictation, click On.
    When you’re ready to dictate text, place the insertion point where you want the dictated text to appear and press the Fn (function) key twice. When you see the lighted microphone icon and hear a beep, the microphone is ready for you to speak your text.
    Shortcut
    By default, you press the Fn (Function) key twice to start dictation. If you like, you can choose a different shortcut from the menu.
    To create a shortcut that’s not in the list, choose Customize, and then press the keys you want to use. You can press two or more keys to create your shortcut.

    I noticed with version 10.8.4 of OS X that I am now able to select F6 to activate, and the return key to complete the speech recognition. This is still different than the description of how these should function that's included in the help, but at least it's an improvement.

Maybe you are looking for