About JTextArea and JScrollPane question

I make a swing program to run a test,a JTextArea can display the test content ,and the content increased continuously,but the vertical scroll bar is always on the top .I want the vertical scroll bar at the bottom at all time so that we can read the newest content from JTextArea.
How can I do?

textArea.setCaretPosition( textArea.getDocument().getLength() );

Similar Messages

  • Need help fast :a question about jcomponent and jscrollpane

    I draw a graphic on a jcomponent like this :
    class drawrecttree extends JComponent {
    public void paint( Graphics g) {
    and I add this to jscrollpane:
    drawrecttree www=new drawrecttree();
    www.k_choose=k_valuenow;
    www.node=currentNode;
    www.setAutoscrolls(true);
    jScrollPane2.setViewportView(www);
    but I hope the jscrollpane can autoscroll,that means jscrollpane's size is 400*400,if the Jcomponent's size is 200*300, just add jcomponent;if jcomponent is bigger than 400*400,the jscrollpane can autoscroll,how can I do that?
    Edited by: hcgerard on Jan 8, 2008 2:18 AM
    Edited by: hcgerard on Jan 8, 2008 2:22 AM
    Edited by: hcgerard on Jan 8, 2008 2:52 AM

    Below is a small non-compilable unit (you need to add a few things of course) - but at any rate, here is some code that, if you get it working, you will see that the scrollbars do the right thing.
    public class TestScrollPane  extends JFrame {
      private Container     container;
      private JPanel        panel;
      private JLabel        label;
      private JScrollPane   scroller;
      public TestScrollPane() {
        container = getContentPane();
        panel     = new JPanel();
        panel.setLayout(new BorderLayout());
        /* Get you images here ...                */
        /* I will call them imageOne and imageTwo */
        label     = new JLabel(new ImageIcon(imageOne));
        panel.add(label);
        scroller  = new JScrollPane(panel);
        scroller.setPreferredSize(new Dimension(100, 100));
        container.add(scroller);
        pack();
        /* Rest of JFrame stuff */
      public static void main(String[] argv)  throws InterruptedException {
        TestScrollPane tsp = new TestScrollPane();
        Thread.sleep(5000);
        tsp.label.setIcon(new ImageIcon(tsp.imageTwo));
        Thread.sleep(5000);
        tsp.label.setIcon(new ImageIcon(tsp.imageOne));
    }

  • About Import and Export question!

    I'm from China and a new DBA with a little experience with Oracle administrator.I meet some questions and can't solve.
    I have a database server (With Oracle Server 7.3.2 for NT),I exported the datas as follows way from a workstation which is oracle client and have admistrator tools.
    exp73 system/manager@nts-com full=Y file=c:\czdata.dmp
    Enter array fetch buffer size:30720
    Export grants :Y
    Export table data :Y
    Compress extents:Y
    And last export terminated successfully without warning.
    In the next,I began imported it into the New database Server(With Oracle Server7.3.2 for NT) with a workstation which is oracle client and have admistrator tools ,too.
    imp73 system/manager@nts-com1 file=c:\czdata.dmp
    The error message appeared:
    IMP-00016:
    IMP-00000:
    In the two databases,I had run the sql before the database was setuped:
    UPDATE PROPS$ SET VALUE$='CHINA' WHERE NAME='NLS_TERRITORY';
    UPDATE PROPS$ SET VALUE$='CHINESE' WHERE NAME='NLS_LANGUAGE';
    UPDATE PROPS$ SET VALUE$='ZHS16CGB231280' WHERE NAME='NLS_CHARACTERSET';
    And the same tablespace,users in the database.I couldn't find the causation.
    What can I do? Please give me such a case which was resolved successfully as detaileder as more. Thanks very much!
    null

    hello,
    I don't know if my question is clear enough but I mean is there a method to export the model as a DDL code
    Thanks
    AL

  • About VRML and JAVA question?

    i have some question......
    import vrml.*;
    import vrml.field.*;
    import vrml.node.*;
    public .........
    when i complie the file contain this, the complier said that there haven't this files or function, how can i use this function? where can download this?
    Thank you

    when i complie the file contain this, the complier
    said that there haven't this files or function, how
    can i use this function? where can download this?There are no packages called vrml.* in the jdk. What do you want to do with the files? If you want to visualise the models you could have a look at Java3D, they have some preprogrammed model loaders for VRML if I remember correctly. If you just want to manipulate the markup you can also use the DOM or SAX parsers.

  • Questions about discount and contract ect.

    I just realized that I can't see my military discount on My Verizon page. I am not sure if I am still getting discount though...
    Am i still getting discount?
    and another question is that I recently lost my cell phone... Also I am in Afghanistan so my phone isn't connected to Mobile data...I can't locate my phone.
    Guess I have to buy a new phone or pay $99 for same old phone with Asurion.
    But I am thinking about cancelling verizon contract with paying $350.
    So I told my mother to go visit verizon store but they refuse to cancel my service she even brought my deployment order and ect. So I am going to try to cancel it myself.  Since I don't have my cell phone with verizon service Can i call you with another phone that is not mine? 
    And Can I use DSN phone to call you?

        Ensuring you get the best value for your money is very important Min.S.Kim. I am happy to inform you that you may check your employee discount by signing into your My Verizon account online by clicking http://bit.ly/xB4iTc 
    I understand you recently lost your phone. Unfortunatley, there is not a GPS way to track the device. We would love to look at replacement options for you because we certainly do not want to lose you. Have you checked to see if you are eligible to upgrade? You may check your eligibility data also by signing into your My Verizon account online. In the event you need to reach us, you may do so by calling 908-559-4899 which is a toll free number when you are out of the country.
    Another option you have instead of cancelling service is to place your account on a Military Suspension without billing. You may suspend service for up to 3 years. For more information regarding our Military Suspension click, http://vz.to/1ddOJkC
    Thank You,
    MichelleL_VZW
    VZW Support
    Follow us on Twitter @VZWSUPPORT

  • A question about grub and USB

    Hi All
    I have a quick question about grub and USB that I can't quite find the answer to by searching.   Most of the FAQs discuss booting a full linux dristribution from USB. My situation is this.  I am getting a new computer with two drives, the second will be arch and the first will be Vista (for my wife).  I want the computer to boot the same way that my wife's machine boots at work so I don't want to install grub on the MBR.  So, is there a way to have all of the grub config files and kernels installed on the second drive and simply install to grub boot loader to the MBR of a USB stick?  My goal would be to simply plug the USB stick into the new PC and boot arch from the second drive. 
    Thanks
    Kev

    i cant say for hp's
    havent worked on any in a while
    recent machines have been coupleof dell's , vaio & emachine
    which dells do offer it at least the ones i tried , my laptop does(dell)
    all home pc's are built by me which do offer to boot individual drives
    what hp you getting it may tell in specs
    are both discs sata? if so it might not offer this option with 2 drives of same interface
    check your power supply alot of these preconfigured machines put cheap under reated power supplies in there
    & will burn your motherboard i just replaced PS(250 watt) & mobo(845gvsr) in an emachines <cheap stuff<
    i hope you researched the pc before buying ie : mobo, power supply are the biggest concerns
    i find it much more benificial to build my own machine gives me peace at mind. the cost is sometimes more in $ but not always , your biggest expense is time researching hardware
    if you live in usa the best places to start looking are bensbargains.net & pricewatch.com
    i am not affiliated with either & niether sell the hardware they are just advertisers a place to buy
    for costomized machines that i would trust is unitedmicro.com theyll asemble & test before shipping
    i have gotten 2 machines so far from them with NO PROBLEMS with hardware (knock knock)
    you may want to consider this in your next venture for pc

  • Update on my K8N and a question about voltage

    Well,
    I've read all the threads in this and several other forums about the k8n.  I have tried everything (including putting my raid on sata 3 & 4).  I cannot go above 235 - 240 HTT and that's with an 8x multiplier (also tried 10, 9, 7, 6, 5, 4) and memory set to 166.  This is using clockgen (also tried through the bios).  
    I can run 220 HTT 11x multiplier (3400+) with 1:1 memory and it is 100% stable.  I have the 1.2b5 bios.  So I'm still pretty bummed about the lack of OCing.
    Anyway, on to my question.  When I bring up CPU-Z and look at the CPU tab. The voltage jumps around a bit.  I have it set to 1.55 the bios and CPU-Z will display 1.552, 1.568, 1.552, 1.536, 1.552, etc. back and forth jumping every few seconds or so. Also the core speed fluxuates by about 0.1 MHz for each jump. So..... Is this normal or is my power supply wacked?  I've just never seen this before on my previous computers.
    Thanks!

    My voltages do the same thing. Since it's not a huge percentage of the total voltage, I wasn't too worried about it and attributed it to tolerance.

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

  • A few questions about MacBooks and Parallels Desktop.

    I have a few questions about MacBooks and Parallels Desktop.
    1) I understand I need at least 1GB of RAM to run Parallels Desktop but what about the hard drive, is the stock 60GB drive big enough?
    2) Related to question 1, even if it was big enough to allow me to install and run Windows would the 60GB drive be enough if I wanted to install a Linux distribution as well?
    3) This has nothing to do with Parallels Desktop but thought I'd ask it here anyway, do Apple Stores carry just the stock MacBooks, or do they carry other configurations?
    Thanks
    Keith

    1. Depend on how intensive you use that HD for saving data on both Mac OS and XP. For standard installation on both OS X and XP, the space of 60 Gb is enough.
    2. Same answer as no 1. You can install all three on that HD space, but the extra spacce available will be less and less for your data. You can save your data on external or back up on cd/dvd and erase it from the HD to keep the free space.
    Remember to leave at least 2 or 3 Gb for virtual memory usage.
    3. Just call them, maybe they don't have it in store stock, but by appointment they might configure one for you before your pick-up date.
    Good Luck

  • One question about Pricing and Conditions puzzle me for a long time!

    One question about Pricing and Conditions puzzle me for a long time.I take one example to explain my question:
    1-First,my sale order use pricing procedure RVAA01.
    2-Next,the pricing procedure RVAA01 have some condition type,such as EK01(Actual Costs),PR00(Price)....,and so on.
    3-Next,the condition type PR00 define the Access Sequences PR00 as it's Access Sequences.
    4-Next,the Access Sequences PR00 have some Condition tables,such as:
         table 118 : "Empties" Prices (Material-Dependent)
         table 5 : Customer/Material
         table 6 : Price List Type/Currency/Material
         table 4 : Material
    5-Next,I need to maintain Condition tables's Records.Such as the table 5(Customer/Material).I guess the sap would supply one screen for me to input the data of table 5.At this screen,the sap would ask me to select one table,such as table 5.When I select the table 5,the sap would go to the screen to let me input the data of table 5.But when I use the T-CODE VK31 or VK32 to maintain Condition tables's Record,I found it's total different from my guess:
    A-First,I can not found one place for me to open the table,such as table 5,to let me input the data?
    B-Second,For example,when I select the VK31->Discounts/Surcharges->By Customer/Material,the sap show the grid view at the right side.At the each line of the grid view,you need to select the Condition Type at the first field.And this make me confused very much.Why the sap need me to select one Condition Type but not the Condition table?To the normal logic,it ought not to select Condition table but not the Condition Type!
    Dear all,I'm a new one in sd.May be this is a very stupid question.But it did puzzle me for a long time.If any one can  explain this question in detail and let me understand the concept,I will appreciate him/her very much.Thank you.

    Hi,
    You said that you are using the T.codes VK31 or VK32.
    These transaction codes are used to enter condition records for standard condition types. As you can see a grid left side having all the standard condition types like price, discounts, taxes, frieghts.
    Pl check using T.code VK11 OR VK12 (change mode)
    Here you can enter the required condition type, in the intial screen. (like PR00, MWST, K004, K005 .....etc)
    After giving the condition type, press enter or click on Combinations icon on top of the screen. Then you can see all the condition tables which you maintained for that condition type. Like as you said table 118, table 5, table 6 and table 4.
    You can select any table and press enter, then you can go into the screen in which you have all the field cataglogues you maintained for that table. For example you selected combination of Customer/Material (table 5) then after you press enter then you can see customer field on top, and material fields.
    You can give all the required values and save the conditon record.
    Hope this is clear.
    REWARD IF HELPFUL.
    Regards,
    praveen

  • 2 question about GPU and Lens correction ,cs5

    Hi
    i have 2 questions about Gpu and lens correction in Cs5
    1)Filter->lens correction->search online
    i get often and almost every connection time out at the first click on search online , at the second click i get no online profile
    is it normal?
    2) question is about Gpu
    it run faster , but talking about ajustament layer
    like saturation or vibrance for example
    i found with the gpu on , a light slow refresh compared with gpu off
    i have set cache  levels 6 ,history 20
    i guess are the defaul
    well i add a saturation layer and move the saturation slide ,increase o decrease saturation
    with Gpu Off , the changes are immedially , i mean i can see in real time the increase o decrease of saturation
    with Gpu On it takes a few(very few) time more
    again is normal ?
    don't be angry , i'm going to buy cs5 and i'm unsecure ... the price make a big role
    thanks

    For what it's worth, I also see a timeout on the first [ Search Online ] click, after about half a minute delay.  Second click turns up results immediately.  This happens each time Lens Correction is started, even without restarting Photoshop, and in both 32 and 64 bit versions.  Also note that I started with one profile listed by default (though from the wrong camera) for my 40D with 28-135 zoom.
    I alsow noticed that I was seeing progress bar activity in the Lens Correction dialog while I was typing this (even though Lens Correction was NOT the active window) every time I hit the 'L' key.  Strange.
    Windows 7 x64.
    -Noel

  • Three questions about Java and Ftp

    Hello, i've the following questions about Java and Ftp:
    1- .netrc file is in $HOME directory but i can't access to this directory from java code. The following line producesan Exception (directory doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");
    2- .netrc file must have the following permissions: -rw- --- --- but when i create the .netrc file the following permissions are on default: -rw- r-- r--, how can i change this permissions? (In java code, i can't use chmod.....)
    3- Are there any way to pass parameters to a .netrc file? If i get to do this i needn't change the permissions because i can't modify or create/destroy this file.
    Thanks in advanced!!!
    Kike

    1- .netrc file is in $HOME directory but i can't
    access to this directory from java code. The
    following line producesan Exception (directory
    doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");$HOME would have to be replaced by a shell, I don't
    think you can use it as part of a legal path.
    Instead, use System.getProperty("user.home");
    Ok, thanks
    2- .netrc file must have the followingpermissions:
    -rw- --- --- but when i create the .netrc file the
    following permissions are on default: -rw- r--r--,
    how can i change this permissions? (In java code,i
    can't use chmod.....)Yes, you can: Runtime.exec("chmod ...");
    I need to use estrictly the .netrc with -rw- --- --- permissions
    Yes, i can use Runtime.exec ("chmod ..."); but i don't like very much this solution because is a slow solution, am i right?
    3- Are there any way to pass parameters to a.netrc
    file? If i get to do this i needn't change the
    permissions because i can't modify orcreate/destroy
    this file.I don't think so. Why do you need the .netrc file in
    Java at all? Writing a GUI frontend?I want to use automatic ftp in a java program and FTP server, the files and path are not always the same, so i can:
    - modify .netrc (for me is the complex option)
    - destroy and create a new .netrc (is easier but i have permissions problem)
    - use .netrc with parameters but i haven't found any help about it
    Thanks for your prompt reply!!!!
    Kike

  • Docs about RowSet, and Object RowSet questions?

    Docs about RowSet, and Object RowSet questions?
    I can find RowSet forum, so I ask here!
    Can you give me URLs where I can find more about RowSet and URLs for any RowSet implementation?
    Does Borlans, Oracle, IBM, etc., have RowSet implementation?
    I find out about Sun's RowSet implementation, but I can't find Object Rowset in this implementation?
    Is it possible to develop Object RowSet and is it useful?
    I know about O/R tools like Hibernate, but Object RowSet can be useful?
    Run SQL query and get Objects, or maybe even run Object query (like EJB or Hibernate or JDO have) and get Objects.
    No XML mapping mess and simmilar, like with EJB or Hibernate or JDO?

    You can try
    http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    This is a tutorail for RowSet

  • After installing new operating system, Mac started to open word when I turn on the mac and a question always appear about FaceTime.

    After installing new operating system, Mac started to open Word when I turn  on the Mac  and a question about face time always appear when turn on the mac. What should I do?

    Look in system preferences>users and groups>log in items.
    Barry

  • TrackControl, Change Track, and others questions about AvTransmit

    Hi there,
    I've got multiples questions about JMF and AvTransmit, hope you will help
    For a small student project, i'm developing a streaming server using JMF, i have used the AvTransmit example.
    Streaming, etc... everything work fine, i stream music over web
    But i need help with "playlist" :
    // Get the tracks from the processor
    TrackControl[] tracks = processor.getTrackControls();
    First Question :
    The Processor use a MediaLocator to get one track, is there a way to indicate multiples tracks, such as a directory containing multiples audio file ?
    At this time, i can only set 1 file in the MediaLocator.
    I'm using a simple class as Playlist (a File[]), and, when i want to change song, i stop the thread, change the MediaLocator with another file, and restart the thread.
    It works on a Lan, but on Internet, Player (I use VLC for my test) lost the connection, i need to restart VLC to get audio again.
    Second Question
    Is there a more "elegant" way to change tracks ?
    Last Question
    I have think about building my own object Playlist... gasp...
    I've look at the javadoc... but i'm a bit lost... does my class have to implement TrackControl ? what are the object inside etc...
    If someone knows information about this...
    That's all ;)
    Thanks !
    Tommy, french student (sorry for the english)

    First Question :
    The Processor use a MediaLocator to get one track, is there a way to indicate multiples tracks, such as a directory containing multiples audio file ?
    At this time, i can only set 1 file in the MediaLocator.No. The processor uses a MediaLocator to get one file. Files (can) contain multiple tracks.
    You can, in fact, combine the tracks of multiple files together, but, there's no need to do that with your application. AVTransmit2 sends each track as a separate RTP stream, so you'd just be sticking them together just to pull them apart again.
    In general, you want to keep your architecture as one processor per file, one RTP stream per track.
    Second Question
    Is there a more "elegant" way to change tracks ?Yes. It's what I refer to as a jukebox DataSource. I discuss it / explain the concept on this previous thread.
    [http://forums.sun.com/thread.jspa?forumID=28&threadID=5400318]
    What you're essentially doing when you change the MediaLocator is starting over from scratch. You end up with a whole new DataSource, whole new Processor, whole new RTP session. On the LAN, this isn't an issue because it looks like you paused the RTP session (because the IP/PORTs don't change).
    Over the internet, though, when you stop sending and restart, you're very likely going to get a new public NAT port. And so when your stream gets to the client, it's going to look like it's from a different person than the original.
    The solution is to use the jukebox datasource to change the media without restarting the Processor or the RTP streams. That'll ensure that your stream won't move between files from the perspective of the client...
    Last Question
    I have think about building my own object Playlist... gasp...
    I've look at the javadoc... but i'm a bit lost... does my class have to implement TrackControl ? what are the object inside etc...
    If someone knows information about this...Ummmm, your "Playlist" object should just be a Jukebox datasource, so follow the link and figure out how that's supposed to work. If you have questions about it, just ask 'em here (rather than on the older thread)...

Maybe you are looking for