Problem with scrollable pane

public void ReportsOutput()
               JInternalFrame rFrame = new JInternalFrame("Reports", true, true, true, true);
               JPanel rPanel = new JPanel();
               JTextArea reports = new JTextArea(30,30);
               reports.setEditable(false);
               add(new JScrollPane(reports));
               for (int i=0; i < counter; i++)
                    reports.setText(accounts.toString());
               rPanel.add(reports);
               rFrame.add(rPanel, BorderLayout.CENTER);
               rFrame.setVisible(true);
               rFrame.setSize(768,480);
               appDesktop.add(rFrame);
               appDesktop.removeAll();
               appDesktop.add(rFrame);
               appDesktop.validate();
               appDesktop.repaint();
This should add a scrollable pane to the text area. It does not it only shows one array element. Is there something i am overlooking when i add the scrollable pane?

First you add the JTextArea to the scrollpane:
add(new JScrollPane(reports));Then, later on, you add the same JTextArea to a JPanel:
rPanel.add(reports);A component such as a JTextArea can only belong to one parent. When you add the JTextArea to the JPanel, it is effectively removed from the scrollpane.
Edit: Btw, in the future should should preferrably post Swing questions in the Swing forum.

Similar Messages

  • Interlace problem with fast pans, camera moves... any advice?

    Hello: I have a video project, edited in FCP (from SD DVCAM tape source). I exported as a standard 4:3 Quicktime movie, and then encoded as H264 video using the multipass 3ivx codec in Cleaner.
    I now get a blurred horizontal line on camera pans. The blur appears as a broken line on the lower third of the picture.
    Should I not tick the "Adaptive" box?
    I have tried using the de-interlace Eliminate Top Field and the Interlace Auto settings. In both cases I ticked the adaptive box. In both cases I still get a blurred broken line in the lower third area of the video on camera pans.
    I tried a third experiment using DVFilmMaker. I set it up to de-interlace only on movement, and to blur horizontal lines on Motion (thinking this might help to at least give a more natural look to the picture break-up I was already getting).
    Alas, no improvement.
    Yes, if I had a time-machine and extra bucks I would have shot Progressive... but I didn't... so I'm trying to get the best out of what I have.
    Any thoughts... anyone?
    Thanks
    A
    Message was edited by: Adrian Smith4

    Thanks for the info. Just for the record, I have tried all these things too in Compressor, QTPro, Cleaner and DVFilmMaker. I get the same problem with all (a blurred line on fast camera pans)
    My preference for Cleaner (and it's only my opinion) is that it has a more intuitive user interface for correcting gamma, color, image size, bit-rate, without having to search or go to multiple menus. You also see the video as it encodes and visually check any problems with gamma, etc. You can also do a visual before/after check. I guess it's the devil I'm used to.
    Thanks for all the info re. alternatives to Cleaner... but it's not really addressing my original (and existing) problem.
    Thanks
    Message was edited by: Adrian Smith4
    Message was edited by: Adrian Smith4

  • Problems with audio panning.

    Am having problems with audio tracks. For example: when capturing a clip where a person is talking, there would be 2 tracks of audio - one a radio mic (Track 1) and another mic (Tack 2)capturing ambient sound. I often delete the ambient track (Track 2) and am left with the the main audio from a radio mic (Track 1).
    The problem is when I open up the main audio track (Track 1) and pan the audio track from -1 to 0 or even to +1! It says it has done it but the sound still comes out of the left speaker.
    It is a very recent problem that I wonder may be something to do with preferences or settings.
    We have had no problems with the speakers at all.
    Thanks very much,
    Geoff

    You have your audio outputs set to 'dual mono', not 'stereo'.... go to:
    Sequence>Settings> 'Audio Outputs' tab > then highlight the 'Stereo' button, then click OK...
    problem solved...

  • Problem with scrollable resultset of oracle

    I encountered problom like this:
    when I use
    s=createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    and getString of a resultset,I get the right data.
    However ,when I use
    s= createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    and getString of a ResultSet ,
    if the type of the field is Date,then get right data.
    if it is char or varchar2,then i get some thing like
    0x313233,
    all has been found in win2000&solaris
    with oracle 8.1.6
    thanks a lot!

    Hello,
    We've got the same problem.
    It comes from the National Character Set of Oracle Database.
    With WE8ISO8859P1, no problem with using this parameters.
    But with WE8ISO8859P9, we have some hexadecimal return.
    I don't know if it's works with another Character set, but with this, It doesn't work.
    We're trying to find a solution. Because change the character set is not one.
    Good luck.

  • Problem with scrollable content in cs6

    hi out there
    well since i while i'm using the cs6 to create folios. now i have a problem i didn't have in cs5.5. if i create a scrollable content ("durchlaufbarer rahmen" in german) in the folio overlays i can't navigate on the area where this element ist placed. if i place a full screen scrollable content on one page and open the folio on the ipad i'm stuck at this page...
    ...hope someone out there knows a way to fix this problem.
    thanks - alex

    So there is a way to retain the PDF version of an article with this?
    I've tried adding an MSO over a scrolling area of text (separate from the frame, but still on top of it), and I've also tried placing it within the scrolling frame.
    Neither of these worked.
    Is there something I'm missing? What specifically allows this workaround to work? I'd love to include some full page scrolling content without making the viewer get stuck on one scrolling page in the middle of the document.

  • Problems with Scrollable Content : colored lines appear

    Hello,
    We have a book with several Scrollable Content (around a total of 200).
    The fact is that in many colored lines appear. These lines appear i disappear when changing article,
    anyone have any solution?
    THANKS

    Hi
    I had the same problem. I had pasted the scrollable content directly into the container frame, but the pasted content was slightly 'taller' than the container window (the pasted object group was maybe 0.012 pixels larger than the container, so very slight) this caused it to display the coloured lines when I moved it up or down, although left and right movement worked fine. Resizing so the pasted content was smaller and exact pixels not 0.123 px (or the same size) as the container fixed it.
    M

  • Extending JPanel to contain a JRootPane - problems with scroll panes

    I am trying to write a JPanel subclass that contains a JRootPane, similar to the way that JFrame contains a JRootPane. The reason that I am doing this is that I would like to be able to intercept mouse events using the JGlassPane facility, but adding the glasspane to the JFrame is problematic since it then intercepts mouse events over all components in the JFrame, including the menu bar. It seems simpler to me to have the JRootPane owned by a JPanel, to give me better control over intercepting events. I've got an implementation working with the JFrame case, but have had to handle many small "gotchas", and at least one more exists. I'm hoping to simplify things by moving away from this way of doing things.
    I wrote a straightforward RootPanePanel class that extends JPanel and implements RootPaneContainer, delegating all of the add methods to the JRootPane's content pane. Here's the constructor for RootPanePanel:
    public RootPanePanel (LayoutManager layout) {
            rootPane = new JRootPane ();
            rootPane.setOpaque(true);
            rootPane.getContentPane().setLayout(layout);
            super.add (rootPane);
    }RootPanePanel also delegates calls like getContentPane/setContentPane to the JRootPane.
    To test my implementation, I wrote a main method that looks like the following:
    public static void main (String[] args) {
      SwingUtilities.invokeLater(new Runnable () {
        public void run () {
          try {
            JEditorPane editorPane = new JEditorPane ("http://www.archives.gov/exhibits/charters/print_friendly.html?page=declaration_transcript_content.html&title=NARA%20%7C%20The%20Declaration%20of%20Independence%3A%20A%20Transcription");
            JScrollPane scrollPane = new JScrollPane (editorPane);
            JFrame frame = new JFrame ("Test RootPanePanel");
            RootPanePanel panel = new RootPanePanel ();                    
            panel.add(scrollPane);
            frame.add(panel, BorderLayout.CENTER);
            scrollPane.setPreferredSize(new Dimension(800, 600));
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize (640, 480);
            frame.pack ();
            frame.setVisible(true);
          } catch (Exception e) {
            e.printStackTrace();
      });Note that I'm not actually using JEditorPane in my application, but it is the simplest component that displays the problem I'm encountering.
    When this code runs, it is fine, as long as the JFrame is big enough to display the scrollbars for the JScrollPane. If the JFrame is made small enough, the scrollbars are not displayed.
    If I instead add the JScrollPane to the JFrame directly, it behaves as you would expect.
    Is this a problem of mixing heavyweight and lightweight components? It doesn't seem like it should be; in both cases the JScrollPane is handling the same client component, the JEditorPane.
    Any suggestions/ideas are welcome!

    Here's the full RootPanePanel class in case people want to try it out
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.HeadlessException;
    import java.awt.LayoutManager;
    import java.io.IOException;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JLayeredPane;
    import javax.swing.JPanel;
    import javax.swing.JRootPane;
    import javax.swing.JScrollPane;
    import javax.swing.RootPaneContainer;
    import javax.swing.SwingUtilities;
    public class RootPanePanel extends JPanel implements RootPaneContainer {
         private JRootPane rootPane;
         public RootPanePanel () {
              this (new BorderLayout());
         public RootPanePanel (LayoutManager layout) {
              rootPane = new JRootPane ();
              rootPane.setOpaque(true);
              rootPane.getContentPane().setLayout(layout);
              super.add (rootPane);
         public Container getContentPane() {
              return rootPane.getContentPane();
         public Component getGlassPane() {
              return rootPane.getGlassPane();
         public JLayeredPane getLayeredPane() {
              return rootPane.getLayeredPane();
         public void setContentPane(Container arg0) {
              rootPane.setContentPane(arg0);
         public void setGlassPane(Component arg0) {
              rootPane.setGlassPane(arg0);
         public void setLayeredPane(JLayeredPane arg0) {
              rootPane.setLayeredPane(arg0);
         @Override
         protected void addImpl(Component comp, Object constraints, int index)
              if (comp == rootPane) {
                   super.addImpl(comp, constraints, index);
              else {
                   getContentPane().add(comp, constraints, index);
         @Override
         public Component add(Component comp, int index) {
              return rootPane.getContentPane().add(comp, index);
         @Override
         public void add(Component comp, Object constraints, int index) {
              rootPane.getContentPane().add(comp, constraints, index);
         @Override
         public void add(Component comp, Object constraints) {
              rootPane.getContentPane().add(comp, constraints);
         @Override
         public Component add(Component comp) {
              return rootPane.getContentPane().add(comp);
         @Override
         public Component add(String name, Component comp) {
              return rootPane.getContentPane().add(name, comp);
         public static void main (String[] args) {
              SwingUtilities.invokeLater(new Runnable () {
                   public void run () {
                        try {
                             JEditorPane editorPane = new JEditorPane ("http://www.archives.gov/exhibits/charters/print_friendly.html?page=declaration_transcript_content.html&title=NARA%20%7C%20The%20Declaration%20of%20Independence%3A%20A%20Transcription");
                             JScrollPane scrollPane = new JScrollPane (editorPane);
                             JFrame frame = new JFrame ("Test RootPanePanel");
                             RootPanePanel panel = new RootPanePanel ();                    
                             panel.add(scrollPane);
                             frame.add(panel, BorderLayout.CENTER);
                             scrollPane.setPreferredSize(new Dimension(800, 600));                                                                                                                                                 
                             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                             frame.setSize (640, 480);
                             frame.pack ();
                             frame.setVisible(true);                                                                                                    
                        } catch (HeadlessException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                        } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
         public JRootPane getRootPane() {
              return rootPane;
    }

  • Problem with scrollable cursors

    Hello,
    When I try to make a cursor scrollable by using SQLSetStmtAttr with parameters SQL_ATTR_CURSOR_SCROLLABLE and SQL_SCROLLABLE I get the error "[Oracle][ODBC]Optional feature not implemented".
    I have tried it with different types of cursors (Static, Keyset Driven, Dynamic). Isolation level is READ COMMITTED (default). I use ODBC Oracle Driver 11.1.
    What am I doing wrong?

    Can you pls check this link
    How do I get scrollable cursors with instant client unixODBC driver?

  • Interlace problems with zooms/pans on stills

    We are working on a simple slide show with still images. There is a wavering quality to the images as they zoom or pan across the screen. It creates a kind of moray effect that is unpleasant. The movie is going to be projected onto a large screen so it will look even worse. I can't seem to find a way to de-interlace the images except in photoshop. Is that my only option or is there some way to turn off interlace in imovie?

    wavering quality to the images as they zoom or pan across the screen
    That seems to indicate that you used the Ken Burns effect to pan/zoom the images, right? If yes, then you should not be a victim of the nasty old iMovie 3-5 bug Sue provided a link to.
    IMO Photo To Movie's high quality setting renders better quality Ken Burns than, erm, iMovie's Ken Burns effect. Maybe the wavering is caused by suboptimal subpixel rendering in iMovie? (wow, that was a great sentence

  • Problems with scrollable frames

    I have an old DPS file that has videos inside a scrollable frame and they work fine. However, i am updating my files and in the new CS6/cc when i create the content, I group all the items, cut and paste into the smaller textframe and when i go to the Folio Overlays panel with the text frame highlighted, the option for scrollable frames is greyed out.  Video is highlighted but it will not allow me to create a scrollable frame.  Does anyone have a recommendation for what i am doing wrong. 

    You are correct, I missed your point.
    I got it this time though and it worked!
    Wow, nifty work around.  Thanks.
    Now that I have successfully embedded video within the scrollable frame, I am concerned about the 2 GB max from apple.
    I researched streaming video and successfully tested this, however it seems the frame for the video needs to be scaled to the preferred viewable size because there is not an option for “play full screen”.  As you can see in the screenshot below, I am trying to place the video under the play button using streaming content. 
    Do you know if this is possible?
    Jill

  • Problem with scrollable result set

    hi
    can u please tell me how i can get no of rows from a result set..
    i am using thin drivers and connecting to remote database,every thing is working fine if i use fwd only type ,but if u use sensitive type it is giving error
    code:
    stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    i am geting error at this line
    error :
    java.lang.AbstractMethodError:oracle/jdbc/driver/oracleconnection.createStatement
    please help me

    does your jdk include jdbc 2.0? Is your driver updated to support jdbc 2.0 features? have you recently updated either(and forgot to change the classpath)?
    I am running jdk 1.3 and oracle thin(classes12.zip) have not had problems creating/using scrollable resultsets??
    Jamie

  • Problems with Preview pane

    I've attempted to adjust the motion of photos in an iMovie. I clicked on the photo, chosen Media and Photos and the clicked on Show Photo Settings. However, the photo I want to adjust will not appear in the preview pane. It will be black or a photo from my iPhoto library will appear. However, if I Import a photo and add it to the movie, the new photo can be adjusted but only until I save the project. What can I do to address this?

    This might not be your problem, but there is a bug in iM that prevents editing a Ken Burns effect photo if you have previously emptied the iM trash for your project. In that case you would need to reimport the photo before you can edit it. A good rule of thumb is never to empty the iM trash.
    If the above is not your problem, then you should try the oft recommended procedure of 1) closing iMovie and trashing the com.apple.iMovie.plist file found in user/library/preferences (on relaunch iMovie will recreate this file), and 2) repairing permissions by using the Disk Utility app.

  • Problem with Scrollable image in design view.

    So I have defined I want my layout to be scrollable, and that works when I preview it. But the problem is it is not scrollable in design view. Why is this? is there away to fix this?
    Thank's in advance.

    Design View doesn't process code like a brower does. It's primarily used for viewing layout.
    Hence the name Design View.
    You want to click on Live View while in Design View

  • JDBC ResultSet out of memory problem with Scrollable one

    Hey guys,
    I'm facing the following problem when accessing an Oracle 10g database over oracle jdbc driver 1.4.
    I need to access the rows of a resultset (millions of rows) at least twice. Forward only doesn't need much memory - but I can't do a rs.beforeFirst()
    Switching to ResultSet.TYPE_SCROLL_SENSITIVE gives me always an java.lang.OutOfMemoryError: Java heap space exception after rs.next() and I can see the used memory constantly increasing.
    Here is my test code:
    conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:ORCL", "user", "pass");
    Statement my_stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    ResultSet result = my_stmt.executeQuery("select * from stats_big");
    System.out.println("Query back :)");
    while(result.next()) {      //here happens the error after 200 000 rows
    //make statistics
    //ask user what to do
    result.beforeFirst();
    while(result.next()) {
         //apply function and deliver new values
    conn.close();
    Is the implementation caching all the already read rows in memory?
    Any help would be great,
    Alex

    if and how there are ways to read a Resultset 2 or more times
    forward-only and the data is not completelly cached on the client If the client reads a million rows, how can it read them a second time without either storing them somewhere on the client as in scrollable cursors, or rereading them from the server as in regular cursors. To me this looks like the laws of physics, rather than something that can be changed in a software release.
    In order of preference I would
    1. Not process a million rows on the client.
    2. Use a regular cursor and fetch it twice, the second fetch will be faster as the database already caches as much of it as it can.
    Fetching that much data somewhere is going to take some time anyway, which is why I prefer the first option..

  • Problem with content pane

    hi,
    if I have to add three different toolbars in same content pane.
    If I add these, each one of them gets overwrite over another. and only last one toolbar gets visible. please help. Also, I need the toolbar to keep top most when i dock them.

    shamail says - "I guess you didnt read the message carefully"
    late4ever says = "u can't add more than 1 toolbar on top"
    Did either of you bother to take the time to read the tutorial on "Using Layout Managers". A JToolBar is simply a component. Multiple components can be added to a container. By default the content pane uses a BorderLayout which only accepts 5 components (Center, North, South, East, West) which is why when you keep adding components to the same area you can only see the last one.
    When you create a JPanel, by default it uses a FlowLayout. When you add components they get added to the right of the previous component, which was why I gave you the sample code.
    I thought my previous answer was straight forward so I only included a piece of code. Here is a complete program you can run:
    import javax.swing.*;
    public class MultipleToolBars extends JFrame
         public MultipleToolBars(String strName)
              this.setTitle(strName);
              JPanel jp1 = new JPanel();
              JToolBar jtb1 = new JToolBar("tool1");
              JToolBar jtb2 = new JToolBar("tool2");
              JToolBar jtb3 = new JToolBar("tool3");
              JButton jb1 = new JButton("JB1");
              JButton jb2 = new JButton("JB2");
              JButton jb3 = new JButton("JB3");
              JButton jb4 = new JButton("TOOL1");
              JButton jb5 = new JButton("TOOL2");
              JButton jb6 = new JButton("TOOL3");
              JButton jb7 = new JButton("BUTTON1");
              JButton jb8 = new JButton("BUTTON1");
              JButton jb9 = new JButton("BUTTON2");
              jtb1.setFloatable(true);
              jtb2.setFloatable(true);
              jtb3.setFloatable(true);
              jtb1.add(jb1);
              jtb1.add(jb2);
              jtb1.add(jb3);
              jtb2.add(jb4);
              jtb2.add(jb5);
              jtb2.add(jb6);
              jtb3.add(jb7);
              jtb3.add(jb8);
              jtb3.add(jb9);
              jp1.add(jtb1);
              jp1.add(jtb2);
              jp1.add(jtb3);
              getContentPane().add(jp1);
         public static void main(String[] args)
              MultipleToolBars mtb = new MultipleToolBars("test");
              mtb.setSize(600, 75);
              mtb.setVisible( true );

Maybe you are looking for

  • What to do with water damaged MacBook Pro?

    I've had my MacBook Pro 13" since late last year and since then have spilt soda on it 2 times. The first time it didn't seem to be damaged at all by it but the second time the macbook turned off and I left it for a while before trying to turn it on a

  • ORA-12514 error while connecting to server

    I am using instantclient to connect to Oracle 9i server. The connection string is given using this format //host:[port][service name]. In our development environment we can successfully connect to the server. But the connection fails in the productio

  • N80 Display Blinks

    I recently upgraded the firmware on my N80 to V 4.0623.0.41 26-97-2006 RM 92 Nokia N80 (12) The screen now blinks intermittently (goes completely blank for about 1 sec), which causes the applications that I am using to reset sometimes- eg PC Suite. I

  • Unable to install new applications to iPhone with iTunes 8

    Hello, I am a Mac Newbie. My wife and I share a MacBook (10.5.5), we both have administrator accounts on the MacBook. We both have iPhones (2.1). I have downloaded numerous song and applications to my iPhone. My wife tried to download a few applicati

  • Airplay with wifi and no internet ?

    I need to use only airplay, can I do it over a wifi network with no internet connection?