Table does not fit into JScrollPane...

Hello,
I created a JTable and want to put this table into a JScrollPane, because the table is larger than the screen-size. The problem is that I never get the horizontal ScrollBar displayed, and the columns of my table are pressed together.
Just try yourself, here's a piece of my source code:
JTable table = new JTable(100,100);
JScrollPane pane = new JScrollPane(table);
I tried different constructor-versions of the JScrollPane-object, but the result was always the same: very very small columns and no horizontal ScrollBar.
Who can tell me how to do so...? I'd be very pleased about any kind of
advision because this problem really drives me crazy...
Thanx, Findus

Hi,
The reason that the horizontal scrollbar is not appearing is because you have the columns as resizeable. By default the column are automatically resizeable. You have to switch off the resizing.
The code should be something like this (an example)
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.JScrollPane;
public class MyFrame extends JFrame {
private JTable table = null;
public MyFrame() {
try{
GUI();
catch(Exception ex) {
ex.printStackTrace();
private void GUI() throws Exception {
table = new JTable(100, 100);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
this.getContentPane().add(new JScrollPane(table);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setSize(400, 400);
this.setVisible(true);
public static void main(String[] args) {
MyFrame app = new MyFrame();
I hope this helps

Similar Messages

  • Table does not fit into window.

    Hi Guys,
    When I execute the Smartforms I get this message ? '
    "Table does not fit into window."   any guess why this message ?
    Regards

    >
    P R Raghu wrote:
    > "Table does not fit into window."   any guess why this message ?
    > Regards
    If TABLE does not fit WINDOW try to take it through the DOOR LOL
    Doesn't the error seems self explanatory to you?
    Regards
    Karthik D

  • Error:   Table TEMPLATE_HEADER does not fit into window.

    Hello Experts ,
    I met a very strange problem.
    I am printing a process order using smartform.
    for other process nrs , print perfect.
    But only for a certain precess nr, I got a popup error 'Table TEMPLATE_HEADER does not fit into window.'
    At beginning , I suppose my table line extend the mainwindow width. But infact , no!
    I try to comment every node one by one, I found the reason: I put a table line into a loop node, if I add a text node which has something inside, it will triger this error. (only for this process order, others works fine)
    so , does someone met this error before ?
    Please help me!!
    Regards
    Kevin

    Hi Kevin,
    Which printer and device type do you use? For line printers and device type(driver STN2) like e.g. EPESCP9, the SAP system
    must use spaces and empty lines to place the text. This is a limitation of the ESC/P printer languagesa per SAP note #19807.
    For this, the Smartforms rounds all coordinates(of the table cells and the window). Only after this step it checks, whether the table fits into the window. So if the table size is quite close to the window size size, it may happen on line printers that the table doesn't fit anymore.
    If this is the reason for your problem, the error message should vanish if you increase the size of the window containing table TEMPLATE_HEADER a little in your smartform.
    Regards,
    Aidan

  • Getting "Table %TEMPLATE does not fit into window" error

    Hello,
    I am trying to print a form to an old EPSON DFX-9000 dot matrix printer and am getting the error message Table %TEMPLATE does not fit into window".
    This only happens when I go to that printer.  I can print fine to a laser printer.
    I have tried creating a new device type and copying over the format from the laser printer, playing with the format, changing formats, ect.
    I have adjusted the size of the window that my template cannot allegedly fit into but still no luck.  I have checked the height and width of the template and the window many, many times and still get the same error.
    Has anyone seen this before?  Please help.   Thanks.

    Hi James,
    You need to see the width and height of the Page Format which you have set in Form Attributes of your smartforms.
    What ever you create should be within this width and height .
    So accordingly adjust the width and height of your windows and components within them
    Regards,
    Dep

  • Window does not fit into page

    Hi all,
    I'm creating a smartform which prints one internal table consists of 36 fields. In table line type i have mentioned the 36 fields. First four are of 4CM and other 32 fields of 2CM width. So in total i have mentioned as 80 CM. 
    But its showing an error like 'Main window does not fit into Page'.  
    What could be the mistake?
    Can anyone help me in this..
    Regards,
    Shanthi

    Hi,
    U have to adjust the 36 fields into 21 cm by Allocating Space accordingly.
    if Your Space is small then data will be displayed in the next line.
    And display The data in Smallest  font possible.
    Regards
    sandipan

  • I recently bought a Macbook Air and a Thunderbolt Display and the laptop's power is supposed to come from the display, but the power cable on the display does not fit into the Macbook Air.

    I recently bought a 11" Macbook Air and a 27" Thunderbolt Display.The laptop's power is supposed to come from the display when connected, but the power cable on the display does not fit into the Macbook Air.

    If your MBair is a 2012 model, it has a Magsafe 2 power connection.  The monitor probably has the old magsafe connection.  If this is the case, you need this adapter.
    http://store.apple.com/us/product/MD504ZM/A?fnode=5a

  • Transportation error - SIPT_INSERT_FI (SIPT_DATA|11) does not fit into the existing function group ((SIPT_DATA_FI|02))

    While performing a system maintenance task we came across this Transportation error - SIPT_INSERT_FI (SIPT_DATA|11) does not fit into the existing function group ((SIPT_DATA_FI|02))
    Can someone help us in resolving this
    Thanks and regards
    RS

    Please expand the log also please check the SAP note 1835436
    Regards
    Aneesh

  • Template does not fit into the window

    Hello all,
    <b>Template does not fit into the window (Message no. SSFCOMPOSER173)</b>
    I am getting the above error in when i try to preview my smartform.
    The template is in footer window. I have only 3 lines in the template.
    And the size of template is less than window size.
    I do not understand why this error. This happened when there are many line items in the main window. With less no. of line items it worked well.
    If you have any suggestions Please help.
    Thanks.

    Hi,
    Please check the following points:
    1. Font size and font family.
    2. Line spacing
    3. Allignment.
    4. Left and right margin
    Deserve Rewards.
    regards.

  • Datagrid Scrolling Problem.. Does not fit into Parent Container..

    Hi All,
           I have a module and module contains only one datagrid. I am adding this module to tab navigator dynamically in the next index. I am using Text as Item renderer in the datagrid and the row height will change depending upon the data diplyed on the Text. When the data populate in datagrid the datagrid going beyond the containers layout. i.e height is not fit into parent container. I am using Canvas as parent container .. Please find the below attached pictures and you will get to know what is my problem?
    Please help me to get out from this issue.. It is urgent..

    Thanks for quick reply
                   Here I am adding this module to canvas and the canvas is also dynamic . As you said "customize the measure() method in Text control and return the correct measuredHeight based on the explicitWidth."  what is the relation between Text control height and datagrid? Datagird should take it's parent container width and heights.  I am newbie to this Flex.. can you please explain it briefly. And if you have any Other way to do this please tell me .. it is very helpful to me.. Can you please post cusomized measure method if possible. please

  • 3.3V CardBus Card does not fit into T500?

    I got a new T500 2055WVJ last week with Win 7 64bit.
    I have only one problem. The cardbus slot (it must be one, because the device manager says RICOH compatible CardBus controller) does not like my Adaptec SCSI CardBus card (Type II). Other PCMCIA cards (5V, non Cardbus) in the same slot fit in perfectly, but the 3.3V SCSI card goes in but stops about 5 mm before they is completely in. The same card works in all other laptops including my old T60, where is slides in and is recognized perfectly. Also CompactFlash cards inside an PCMCIA adaptor fit in perfectly on my new T500 and appear as ATA devices.
    Looking into the slot with a lamp shows that on the left side, the notch for differentiating between 5V and 3.3V cards only allows 5V cards. But the CardBus spec says, that Cardbus cards must be 3.3V. You can see a picture of the difference between cardbus and pcmcia pccards here: http://de.wikipedia.org/w/index.php?title=DateiCCard_CardBus.jpg&filetimestamp=20061112220451 (you see the different notch on the right side).
    So whats wrong here? Does the new Thinkpad really does not like 3.3V CardBus cards, although the controller is CardBus?
    Solved!
    Go to Solution.

    Congrats on getting it to work!
    Thinking back, I remember how reluctant I was to force a card into my new T500. I do think there is something slightly off about the slot, because the same card had been working fine in my old T42. (Or maybe the T42 was similarly stiff when it was new way back when?)
    Anyway, congrats again!
    Results of Your Ideal Business-Class Laptop survey, concluded 2009-07-29.
    Did someone help you?
    Say thanks! with a kudo.
    Even better: Pay it forward, help someone else.

  • My Iphone Touch 4rd gen does not fit into Bose system

    I got me a new Ipod touch 4rd gen. Now it doesn't fit into my Bose system? Also not in my daugters Sony?
    Cable fits and it charges.

    If the docks use the universal dock system then you need to purchase these:
    http://store.apple.com/us/product/MC650ZM/A?fnode=MTY1NDA0OQ&mco=MTg5MTgxMjc
    Otherwise you can use a dock extender cable or use a knife and tape or similar to make the iPod fit.
    Cable:
    http://www.amazon.com/Connector-Extender-Extension-Cable-iPhone/dp/B004BJLXAM

  • Airport Extreme Card does not fit into my laptop.

    I recently purchased an Apple iBook G4 and a separate Airport Extreme Card. Maybe I'm just Mac-illiterate, but I can't figure out how to install the card. I've studied the directions in the manual and online but the diagrams don't seem to correspond with my laptop. For example, my laptop does not have the grey wire or metal bracket that are shown in Figure 6 at http://www.info.apple.com/usen/cip/pdf/ibkg4/ibg4-apc-cip1.pdf. In fact, that whole area in my laptop looks very different from the way it looks in the image. The card doesn't fit/snap in anywhere under the keyboard.
    Am I totally missing something? Is the card supposed to be installed elsewhere? Did I perhaps purchase the wrong card?
    Any support you can offer will be greatly appreciated. Hopefully my question isn't too stupid!

    Current generation iBook G4's have a built in Airport Extreme interface - they don't make use of a user-installable Airport Extreme card.
    Does your Mac have an Airport menu item (the fan-shaped icon near the right side of the MacOS menu bar)? If so, it already has an installed Airport interface.

  • Table TEMPL_FW6 does not fit into window.

    Hello All,
    My smartform driver program is giving me this error. What could be the problem .can anyone help me out in this.

    Hii
    this error u can get it in smartform itself
    change the width of ur template & when u specifying the text check the line types
    any of them ur missing
    reward points if useful
    regards
    Jaipal

  • Lightening to 30 pin adaptor does not fit into 5s when in the apple case

    Any ideas how to plug an old 30 pin car cable into the 5s whilst in the apple case, don't want to have to give mini £50 for new one when I,be already spent £25 on an adaptor?

    That isn't really an adequate answer is it Peter. It's ridiculous that Apple couldn't make an adapter that fits their own OFFICIAL case. Lets refer to your previous post on something similar shall we: https://discussions.apple.com/message/20076166#20076166 - maybe Apple should look at what other case makers are doing and bothered to design the case to work in any iPhone5/S environment including the cut out to handle the wider base of the 30 pin adapter.

  • Headphone Jack does not fit into my new Sansa Clip +

    Hi, I just bought a new Sansa Clip + so I could listen to my songs while on vacation, but when I put in my headphones 3.5 jack plug into the hole on the side of the mp3 player it  won't go all the way in and falls out if I dont hold it properly. Is that how a Sansa Clip + is ? because I found it very annoying.  I hope that someone can reply fast because I will be on vacation in about a week. And sorry for my english because it is not my native language.

    When the player is new the jack is very tight, and it takes a bit of force to get the plug in completely.  

Maybe you are looking for

  • Office web apps crome issue

    I have SharePoint 2013 integrated with office web apps. I have activated the feature Open Documents in Client Applications by Default. If I open word document in Internet explorer it opens in client application but if I open same word document in cro

  • Searsh help in dailog programming

    Hi, I have made a search help for a field in module pool.. i am getting the required result. My requirement is that i have to fill the other 5 fields on the screen based on my selection of the value in the search help. can someone help me out here?

  • Can't merge separate PDFs into a single PDF

    I receive the following when attempting to merge separate pdf files into a single pdf file in Acrobat 8.1.2 using OS 10.5.4 on my iMac: At least one file in the list requires a password. The combined file will not be secured. Do you want to continue?

  • Errors when loading flat file data

    We just test to load a very simple flat file data with only two lines and the two lines of data in preview of InfoSource is correct.  But when run InfoPackage to load data, the monitor of the InfoPackage shows the following errors (see in between two

  • FYI - High precision data issue with sdo_anyinteract on 11.2.0.3 with 8307

    For anyone that may happen to be experiencing issues with SDO_ANYINTERACT on 11.2.0.3 with high-precision geodetic data, I currently have a service request in to fix it. The issue we have is with locating small polygons ("circles" from 0.5"-4") in th