JScrollPane policy

I have a GuiPanel which I add to a JScrollPane policy.
If I have the following (where p is my GuiPanel):
add(new JScrollPane(p))
The vertical scroll bar never appears.
If I have:
add(new JScrollPane(p,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER));
The vertical scroll bar never appears
If I have:
add(new JScrollPane(p,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER));
Then the vertical scroll bar always appears.
Any ideas why the scroll bar doesn't appear as needed for the first and second ones?

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
  public Test() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    JPanel jp = new JPanel(new GridBagLayout());
    content.add(new JScrollPane(jp), BorderLayout.CENTER);
    GridBagConstraints gbc = new GridBagConstraints(0,0,1,1,1.0,1.0,
            GridBagConstraints.CENTER,GridBagConstraints.BOTH,
            new Insets(1,1,1,1),0,0);
    for (int i=0; i<16; i++) {
      JScrollPane jsp = new JScrollPane(new JTextArea("JTA-"+i));
      jsp.setPreferredSize(new Dimension(100,100));
      gbc.gridx=i%4;
      gbc.gridy=i/4;
      jp.add(jsp, gbc);
    setSize(300,300);
    show();
  public static void main(String args[]) { new Test(); }
}

Similar Messages

  • JScrollPane resize policy

    Hi.
    When you resize a jframe with JScrollPane inside, the top left corner maintains fixed position, that is the point visible in the corner does not change.
    I would like to keep the center point fixed, that is that a point which is visible exactly in the center should be also in the center after resize.
    How to achieve this with JScrollPane? Efficiently, without double repainting after resize.
    Thanks for any help.

    One way is by leveraging JViewport#setViewPosition. Example with some graphics so the effect can be seen:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class FreezeCenterScrollPane {
       private JPanel panel;
       private JScrollPane scrollPane;
       private int midX = 0;
       private int midY = 0;
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new FreezeCenterScrollPane().makeUI();
       public void makeUI() {
          panel = new JPanel() {
             @Override
             public void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.setColor(Color.RED);
                int w = getWidth();
                int h = getHeight();
                for (int i = 0, j = 0; i < w / 2 && j < h / 2; i += 20, j += 20) {
                   g.drawRect(i, j, w - 2 * i - 1, h - 2 * j - 1);
          panel.setPreferredSize(new Dimension(1000, 1000));
          scrollPane = new JScrollPane(panel);
          scrollPane.addComponentListener(new ComponentAdapter() {
             @Override
             public void componentResized(ComponentEvent e) {
                Point oldPosition = scrollPane.getViewport().getViewPosition();
                Rectangle rect = scrollPane.getViewportBorderBounds();
                if (midX != 0 || midY != 0) {
                   int diffX = midX - rect.width / 2;
                   int diffY = midY - rect.height / 2;
                   Point newPosition = new Point(Math.max(0, oldPosition.x + diffX),
                         Math.max(0, oldPosition.y + diffY));
                   scrollPane.getViewport().setViewPosition(newPosition);
                midX = rect.width / 2;
                midY = rect.height / 2;
          JButton increase = new JButton("Increase panel size");
          increase.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
                resizePanel(50);
          JButton decrease = new JButton("Decrease panel size");
          decrease.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
                resizePanel(-50);
          JFrame frame = new JFrame();
          frame.setGlassPane(new JComponent() {
             @Override
             public void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.setColor(Color.BLUE);
                int w = getWidth();
                int h = getHeight();
                g.drawLine(w / 2, 0, w / 2, h);
                g.drawLine(0, h / 2, w, h / 2);
          frame.getGlassPane().setVisible(true);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(400, 400);
          frame.add(increase, BorderLayout.NORTH);
          frame.add(scrollPane, BorderLayout.CENTER);
          frame.add(decrease, BorderLayout.SOUTH);
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
       private void resizePanel(int increment) {
          Dimension d = panel.getPreferredSize();
          panel.setPreferredSize(new Dimension(d.width + increment,
                d.height + increment));
          panel.revalidate();
    }Scroll to the approximate center of the JPanel (the smallest rectangle) and resize the JFrame.
    db

  • JScrollPane questions

    Hi, I have two questions regarding JScrollPane:
    1) I have a JPanel inside a scrollpane, but setViewportView() doesn't seem to work too well. Could anyone give me a better idea how to set the viewport view, an example perhaps? The tutorial doesn't go into much detail. For instance, let's say I have an 800 * 600 JPanel with a spot on it at 500, 300. How would I make the JScrollPane move so that this spot is in the centre?
    2) Is there a method that essentially does the same thing as clicking on one of the scrollbar arrows, so I can have four buttons (Up Down Left Right) that scroll instead of scrollbars?
    Thanks.

    #1
    sp.getViewport().scrollRectToVisible(...)
    import javax.swing.*;
    import java.awt.*;
    class Testing extends JFrame
      public Testing()
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel panel = new JPanel(null);
        panel.setPreferredSize(new Dimension(800,600));
        JLabel label = new JLabel("Hello World");
        label.setBounds(500,300,80,20);
        panel.add(label);
        JScrollPane sp = new JScrollPane (panel);
        sp.setPreferredSize(new Dimension(200,200));
        getContentPane().add(sp);
        pack();
        sp.getViewport().scrollRectToVisible(new Rectangle(440,210,200,200));//<-----------------------
      public static void main(String[] args){new Testing().setVisible(true);}
    }#2
    you can get the scrollbar object/s from the scrollpane and use setValue()
    you can set the scrollbar's policy as NEVER - look up the various constructors
    for JScrollpane

  • JScrollPane with Components?

    hey guys, im writing a program and I have a JScrollPane and i want to have multiple JTextFields and radio buttons in it that work with the scroll pane so you can type something in on lets say field 1 and then scroll down to field 15 and type something into that one. is this possible? so far ive gotten them to show up in the scroll pane but the scroll bar doesnt even appear. ive tried setting the policy to ALWAYS but that little scroll block doesnt appear, only the bar itself thus making any fields below the windows bounds unaccessable. Any idea how to get this working?
    Message was edited by:
    HDL_CinC_Dragon

    run this the 3 times to see the differences
    import javax.swing.*;
    import java.awt.*;
    class Testing extends JFrame
      JPanel p = new JPanel(new GridLayout(0,1));
      JScrollPane sp = new JScrollPane(p);
      public Testing()
        setSize(600,400);
        setLocation(200,100);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        for(int x = 0; x < 50; x++)
           p.add(new JLabel("Hello World"));
        //sp.setPreferredSize(new Dimension(500,300));//test without this line, then with the line
        JPanel p1 = new JPanel();
        p1.add(sp);
        getContentPane().add(p1);
        getContentPane().add(sp);//comment out this line, uncomment above block
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • JScrollPane's scroll bar alignment

    I tried all the suggested methods, and yet I still get the vertical scroll bar aligned somewhere in the middle when the JFrame opens, when top alignment would be preferable... Any suggestion on this is more than welcome. My code is structured with nested components like this:
    JScrollPane scroll
    ---JPanel allJPanels
    ------JPanel a
    ---------JPanel a_1
    ---------JLabel a_2
    ---------JEditorPane a_3
    ------JPanel b
    ---------JPanel b_1
    ---------JLabel b_2
    ---------JEditorPane b_3
    scroll.setViewportView( allJPanels );
    Methods attempted:
    scroll.getVerticalScrollBar().setValue( scroll.getVerticalScrollBar().getMinimum() );
    OR
    scroll.getViewport().setViewPosition( new java.awt.Point( 0, 0 ) );
    OR
    scroll.getVerticalScrollBar().getModel().setValue( 0 );     
    OR
    allJPanels.scrollRectToVisible( new java.awt.Rectangle( 1, 1, allJPanels.getWidth(), allJPanels.getHeight() ) );
    Thanks for any suggestion

    Could you please explain your exact requirement. If you just want whether you have to show the scrollpane or not then there is a policy in JScrollpane in which you can set the vertical scrollbar policy as required.

  • How do I cause JScrollPane to try and get it's contents to resize narrower?

    I have a JScrollPane that contains a JPanel (GridBagLayout) that contains a dynamically added set of panels.
    I've noticed that when I make the app window wider, all the panels get wider (as expected) and properly re-layout their contents to the new width.
    The problem is when I make the app window narrower, all the child panels stay the same width, and the JScrollPane horizontal scrollbar is activated so you can scroll back and forth in them.
    Setting the Hscrollbar policy to Never doesn't help.
    I'd LIKE to have the system attempt to re-layout the member panels to the narrower width, as long as it's not less than their min width. As far as I can tell, it doesn't even try.
    Any suggestions on how to get the contents to attempt to get narrower?
    (And yes, I do need the scrollpane, as we are almost always going to need to scroll vertically, and there are occasionally panels that are just too wide.)

    The scroll pane does not contain a subclass of JTextComponent, but rather a JPanel(GridLayout(0, 1)) containing many JPanels.Check out all your other postings where you've been asked for a SSCCE.
    it isn't, then I've done something wrong and an SSCCExxyqzz is appropriateExactly, when you ask a question you don't know it if is or isn't normal behaviour. So you post your simple SSCCE so we can make sure you aren't doing something silly and to prove that you are doing something "normal". If it is normal behavour then we can try to suggest a solution. If it isn't normal behavour then we don't have to waste time asking for a SSCCE and then waiting hours for you to create the SSCCE. We all only have a limited amount of time to answer questions. The more complete the question, the faster you get an answer.
    Since I've wasted my time explaing this again and again, I don't have any time left to answer the question.

  • JScrollPane's scroll

    i have a jpalel onto JScrollPane, how can I know from program this jcrollpane's vertical scroll is shown or not ( this panel needs scroll or not ).
    Has a JScrollpane object or variable , which messages me this .
    I dont wont solve this problem with size of panel. I wont enything usable and symple.
    enyone know how can I do?

    Could you please explain your exact requirement. If you just want whether you have to show the scrollpane or not then there is a policy in JScrollpane in which you can set the vertical scrollbar policy as required.

  • Resizing columns in a JTable in a JScrollpane

    I have a JTable in a JScrollpane and I after I load the table, I resize the columns to fit the data (works well).
    The problem is that I want the scrollpane to stay the same size and let the table scroll horizontally inside the viewport. The actual result is the scrollpane stretches to the width of the table causing the user to scroll the panel rather than the scrollpane.
    I've tried setting the scrollbar policy but that didn't work.

    I am passing the JTable to the constructor of the JScrollPane.
    I have a JTable in a JScrollPane that sits on a JPanel which is in a JScrollPane itself.
    After I load the data into the JTable, I resize all of the columns to fit the data.
    The problem is that the JTable resizes wider than original size causing the whole panel to scroll horizontally. I would rather have the JScrollPane that the JTable is in scroll.

  • Problems to show a Vertical JScrollPane with JList

    I have a JList within a JScrollPane, and update the JList with the output from a process.
    This means that the JList is updated very quickly with a lot of data.
    The scrollpane policy is set using this :
    myScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    The problem happens as the list is being updated - sometimes the slider on the scrollbar disappears. It can reappear again, but this behaviour seems completely random.
    This means that if the process completes and the JList stops being updated, the lack of a slider prevents me from reviewing the JList contents.
    Does anyone know why this happens and what I can do to prevent it?

    JList displays the contents of a Vector. The Java version is JDK 1.2.2. And I'm using Windows 2000.

  • Help - Problems with JScrollPane

    I am bulding an application which displays several data base records. I want to build a scrolling display which would allow the list to be various sizes.
    However, in setting up the code for JScrollPane, I cannot get the definitions correct because the compiler keeps giving me "cannot resolve symbol" errors on the vertical scrollbar policy.
    I have read the API's and the Tutorial on JScrollPane and my reference book and have tried to set it up as they illustrate.
    The code is below.
    1) What is the correct definition for the scrollbar policy?
    2) Is my code basically correct to get a simple panel scrolled?
    ===============================
    // This Java program is for Listing Pay Periods
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class prcPayPayPerLst extends JFrame implements ActionListener
    public JFrame frmPayPerLst;
    public JPanel pnlPayPer;
    public JScrollPane scrlPayPer;
    JButton btnPayPerEnd;
    JButton btnNewPayPer;
    public void prcPayPayPerLst(Color[] RFSColor, Font[] RFSFont,
                   String DBPwd)
         ColrIn = RFSColor;
         FontIn = RFSFont;
         RFSBkgC = ColrIn[0];
         *** (other programming)
         frmPayPerLst.addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent e)
                   frmPayPerLst.dispose();
                   return;
         frmPayPerLst.setSize(420, 640);
         frmPayPerLst.setBackground(RFSDatC);
         frmPayPerLst.setVisible(true);
    // Connect to and read database
    //     Build data arrays
    //     Define panel
         pnlPayPer = new JPanel();
         pnlPayPer.setBorder(BorderFactory.createTitledBorder("Pay Periods"));
         pnlPayPer.setBackground(RFSDatC);
         pnlPayPer.setLayout(new GridLayout(0, 6, 15, 15));
    // define JButtons, JLabels, etc and load into panel
    //     *** (the display is about 14 rows long now)
    // last, set JButton
         pnlPayPer.add(btnPayPerEnd);
         btnPayPerEnd.addActionListener(this);
    // do JScrollPane - only the first one will compile with no errors
    //     scrlPayPer = new JScrollPane(pnlPayPer, 1, 0);
    //     scrlPayPer = new JScrollPane(pnlPayPer, VERTICAL_SCROLLBAR_ALWAYS, 0);
         scrlPayPer = new JScrollPane(pnlPayPer, ALWAYS, 0);
    //     scrlPayPer.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_AS_NEEDED);
    //     add JScrollPane to Frame and display
         frmPayPerLst.getContentPane().setLayout(new BorderLayout());
         frmPayPerLst.getContentPane().add(scrlPayPer, BorderLayout.NORTH);
         frmPayPerLst.setLocation(50,150);
         frmPayPerLst.pack();
         frmPayPerLst.show();

    Thanks for all the suggestions.
    JScrollPaneConstants.scrollbar_policy works great.
    But I now have a frame being displayed that ignores the size I gave it. The vertical scrollbar is there altho inactive because it displays all the records - going off the bottom of the display to do it. The display has 15 or so records each with 6 columns.
    Why is it ignoring my Size statement?
    Pertinent parts of the code are:
    ========================
    // Define JFrame
    JFrame frmPayPerLst = new JFrame("Heading");
    frmPayPerLst.setSize(420,640); <<<<<=======
    frmPayPerLst.setVisible(true);
    // Define and load JPanel
    JPanel pnlPayPer = new JPanel();
    pnlPayPer.setLayout(new GridLayout(0,6,15,15));
    read database, add JButtons, JLabels, data, etc.
    // Define and load JScrollPane
    JScrollPane scrlPayPer = new JScrollPane(pnlPayPer, vert, horiz);
    // Put scrollpane in frame
    frmPayPerLst.getContentPane().setLayout(new BorderLayout());
    frmPayPerLst.getContentPane().add(scrlPayPer, BorderLayout.CENTER);
    frmPayPerLst.pack();
    frmPayPerLst.show():
    ============

  • JScrollPane Resizing

    Can anyone tell me if there is some method i need to call to have force a JScrollPane to update itself? I have a JComponent inside a JScrollPane and I'm doing some custom graphics within the component. When the graphics are too large i want to scroll.
    From the tutorial, I tried to update the preferred size of the component but that doesn't seem to work. I have to manually resize the window for the scrollbars to resize properly.
    Setting the maximum vertical scroll bar size does work, but my scrollbar policy must always be set to display the scrollbars. In other words, if my scrollbars are already showing, setting the max size works, but if they are not and the graphics resize to large for the first time, the scroll bars are not painted immediately (i need to manually resize).
    Any Suggestions? Thanks in advance.

    needed. Btw, other than the javadocs, do you know of
    a good source for this type of information?This site?
    This is something I had to learn the hard way too; in fact I think a great majority of people learning to build guis in java have this exact same problem. Now that you've seen it and done it you'll know for the future.

  • JScrollPane with scrollbar as needed packs to the wrong size.

    Hi!
    I just noticed a strange problem when packing a JScrollPane with scrollbar policy "as needed" and wondered if it's me or if it is a real bug in Swing.
    I create a JFrame with a JScrollPane in it and a JPanel as viewportview. The JPanel (called "stuffPanel") contains a few components which give it a preferred size, and the JScrollPane is set to grow as needed if the window grows. A button in the center of the stuffPanel will invoke pack() on the window when clicked.
    Now, if I resize the window such that the JScrollPane can't display the entire stuffPanel, I get scrollbars as expected. If I click the pack button the window correctly resizes to the preferred size (without scrollbars).
    On the other hand, if I resize the window to become larger than the preferred size and then click the pack button, the window (and the stuffPanel) is resized to include 17 pixels of extra size around the edges.
    Put simply, pack() will resize the JPanel to different sizes depending on whether the scrollbars of the JScrollPane were visible at the time. Note that this only occurs when you're using the "scrollbars as needed" scrollbar policy.
    An even more interesting situation occurs if you resize the window to include (for example) only horizontal scrollbars and then packs the window repeatedly...
    Code for a Java app which displays the strange behaviour is included below:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TestJScrollPane {
      static {
        try {
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        catch (Exception e) { }
      private JFrame mainWindow;
      public TestJScrollPane() {
        mainWindow = createMainWindow();
        mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainWindow.pack();
        mainWindow.show();
      public JFrame createMainWindow() {
        JFrame window = new JFrame("Test of scrollpane");
        window.getContentPane().setLayout(new GridBagLayout());
        final JPanel stuffPanel = new JPanel();
        stuffPanel.setBorder(BorderFactory.createTitledBorder("Collection of stuff"));
        stuffPanel.setLayout(new GridBagLayout());
        JLabel stuffLabel = new JLabel("A label");
        JTextField stuffField = new JTextField(10);
        JButton stuffButton = new JButton("Pack the window");
        JList listOfStuff = new JList();
        listOfStuff.setListData(new String[] {"Fish", "Bird", "Mammal", "Insect", "Spider"});
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        stuffPanel.add(stuffLabel, gbc);
        gbc.gridx = 1;
        stuffPanel.add(stuffField, gbc);
        gbc.gridy = 1;
        gbc.gridx = 0;
        gbc.gridwidth = 2;
        stuffPanel.add(stuffButton, gbc);
        gbc.gridy = 2;
        gbc.fill = GridBagConstraints.BOTH;
        stuffPanel.add(listOfStuff, gbc);
        final JScrollPane scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scroller.setViewportView(stuffPanel);
        gbc = new GridBagConstraints();
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1;
        gbc.weighty = 1;
        window.getContentPane().add(scroller, gbc);
        stuffButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            mainWindow.pack();
            System.out.println("Stuff panel size: " + stuffPanel.getSize());
            System.out.println("Stuff panel preferred size:" + stuffPanel.getPreferredSize());
            System.out.println("Scroller size: " + scroller.getSize());
            System.out.println("Scroller preferred size: " + scroller.getPreferredSize());
        return window;
      public static void main(String[] args) {
        new TestJScrollPane();
    }

    Why would the JScrollPane be as big as the entire
    frame when you added 800x600 panels on all sides of
    it? It's going to be in the center surrounded by
    huge panels. Thanks, kablair. However, if you look at the code, these panels are not 800x600 on all sides. The north and south panels only add a combined height of 100, and the east and west panels only add a combined width of 100. so the whole window, minus insets, should be 900x700.
    Anyway, i took the advice of the guy above, and that has gotten me much closer. In the bigger app that I'm trying to calculate the size, now I'm only 2 pixels away from the true size, although I can't figure out what I'm forgetting.

  • Swing table and JScrollPane

    I am using JTable with JScrollPane. JScrollPane is set with the scroll bar policy set to AS-NEEDED. But still when my table columns go beyond the table or View Port Horizontal Scroll bar of the ScrollPane does not appear.
    I also tried the ALWAYS policy for Scroll Pane . But still horizontal pane remains disabled.
    Pls suggest some solution.

    Set the autoresize mode of the table to off.
    setAutoResizeMode (JTable.AUTO_RESIZE_OFF)
    Ranjit.
    I am using JTable with JScrollPane. JScrollPane is set
    with the scroll bar policy set to AS-NEEDED. But still
    when my table columns go beyond the table or View Port
    Horizontal Scroll bar of the ScrollPane does not
    appear.
    I also tried the ALWAYS policy for Scroll Pane . But
    still horizontal pane remains disabled.
    Pls suggest some solution.

  • JScrollPane doesn't scroll when appended from outside Thread.

    The strangest thing I've ever seen in Java has just occured. I'm making a client program that uses an outside thread to get input from a BufferedReader that's created from a TCP/IP connection. Now, I'm using a JTextArea, that has been added into a JScrollPane. Within the main thread, if I append to my JTextArea until it reaches the end of it's view, it will scroll down to meet the newly added text. If I however instead append it remotely from a thread I've created, it will append the text, but not scroll. Does any one have any idea how I can fix this?
    -Jason Thomas.

    Your may try one of these:
    1- Contruct the JScrollPane with scrollbar-policy on:
    ...new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    2- Contruct the JTextArea with the number of rows & columns big enough to make the scrollers appear: say ...= new JTextArea(200, 200) so that you always have them
    3- Call invalidate() method on the instance of the JTextArea inside the remote Thread after appending.
    <main thread>
    JTextArea textArea;
    <remote thread>
    public void run()
    textArea.append(...);
    textArea.invalidate();
    4- If the remote Thread appends to the TextArea while the TextArea is being shown (pack), this might confuse the JScrollPane to calculate the preferredScrollableViewportSize. You may Synchronized the remote Thread. Or check this code:
    <main thread>
    JTextArea textArea;
    <remote thread>
    public void run() {
    // wait until the textArea becomes visible
    while ( ! textArea.isVisible() )
    try {
    Thread.sleep(100);
    } catch (InterruptedException e) {}
    // now append
    textArea.append(...);

  • Can't get horizontal scrollbar in JScrollPane to work

    I have a JTable in a JScrollPane and when I load the data the vertical scrollbar shows up and works fine but no horizontal scrollbar shows up even though I have 38 columns in the table. The columns are all very small and even when I manually resize them no scrollbar appears. I have set the scrollbar policy in the JScrollPane to always have a horizontal scrollbar and all that does is show the two arrows at the corners and no bar???

    Maybe you need to call
    yourtable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

Maybe you are looking for

  • Reading JSON data from a URL

    Hi all, I have a requirement of reading JSON data from a particular URL and using one of the value to set one property in iView. I need some info on how to get JSON data from a URL and extracting attribute's value from it. What are the APIs that can

  • Crystal ReportViewer not showing on the browser but the tool bar appears with Print, export etc.

    Hello I am struggling on displaying the Report on the Browser. I am using Visual Studio 2010 and loaded my development box with client Tools. I am calling a report which is hosted on a Crystal Enterprise Server 13 on a remote location. The problem I

  • SSF_API_NOSECTK error in SSFTEST program

    I get the error message ssf_api_nosectk in the SSF test program called SSFTEST. I am running ECC 6.0 and think that I have installed the crypto library ok. I can see everything in STRUST and an able to generate PSEs, etc.  The error message says that

  • Web Analysis: error while trying export to Excel!

    Hi, if I try to export an report in WA to Excel, the following error occured: "HTMLViewer on <SERVER> can't be downloaded ..." (error message is originally in german). Has anyone an idea how to solve this problem? Thanks in advance! Stefan

  • T:tabChangeListener tag not recognized error when using in facelets

    I am trying to use tomahawk's TabChangeListener with PanelTabbedPane, but when I add the tabChangeListener tag in the body of the <t:panelTabbedPane /> , I get an error: "<t:tabChangeListener> Tag Library supports namespace: http://myfaces.apache.org