Not show horizontal srollbar when decrease table size

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
public class SimpleTableDemo extends JPanel {
     final Object[][] data = {
               { "Mary", "Campione", "ooooooooooooooooooooooooooo", "5" },
               { "Alison", "Huml", "Rowing", "3" },
               { "Kathy", "Walrath", "Chasing toddlers", "2" },
               { "Mark", "Andrews", "Speed reading", "20" },
               { "Angela", "Lih", "Teaching high school", "4" } };
     final Object[] columnNames = { "First Name", "Last Name", "Sport",
               "Est. Years Experience" };
     public SimpleTableDemo() {
          JTable table = new JTable(data, columnNames);
          // Create the scroll pane and add the table to it.
          JScrollPane scrollPane = new JScrollPane(table);
          scrollPane.setPreferredSize(new Dimension(400, 100));
          // Add the scroll pane to this panel.
          setLayout(new GridLayout(1, 0));
          add(scrollPane);
     public static void main(String[] args) {
          JFrame frame = new JFrame("SimpleTableDemo");
          frame.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {
                    System.exit(0);
          frame.getContentPane().add("Center", new SimpleTableDemo());
          // frame.setSize(400, 125);
          frame.pack();
          frame.setVisible(true);
}When I decrease table size the vertical scrollbar show, but horizontal srollbar NOT show. Why?

When I decrease table size the vertical scrollbar show, but horizontal srollbar NOT show. Why? Because the table automatically resizes the width of each column.
If you don't want this behaviour then set the setAutoResizeMode(...) method to off.

Similar Messages

  • I am looking for a specific photo in my event folder, it does not show up, yet when I use the search feature, the photo is there.  Why doesn't it show up in the folder?

    I am looking for a specific photo in my event folder, it does not show up, yet when I use the search feature the picture is there.  Why doesn't it show up in the folder?

    What system and iPhoto version are you running?
    If your're using iPhoto 9 or later  Command (right) - click on the photo in the search window and select Show Event in the Contextual menu. 
    That will take you to the event where the photo is.
    OT

  • Fonts not showing correctly only when on my account page on app store

    fonts not showing correctly only when on my account page on app store

    Firstly, make sure that your device is not hidden (left hand pane). If it just reads device then toggle between SHOW and HIDE.
    Secondly, try all the other ports on your computer, even a number of times.
    Thirdly, if you have another computer try plugging your device into it without taking any action, give it a moment, remove it and try it back in your other computer again.
    Failing all that, see here - http://support.apple.com/kb/TS1538 for Windows and http://support.apple.com/kb/TS1591 for Macs
    And failing all that put the device into Recovery mode. See here and note the paragraph 'If you restore from a different computer.... ' down near the bottom of the page -
    http://www.apple.com/support/ipad/assistant/itunes/

  • Itunes store does not show on ipad when i launch app its pages are blank

    itunes store does not show on ipad when i launch app its pages are blank

    This indicates there might be an issue with the time configuration on the device.
    Go to Settings > General > Date and time. See if Set automatically is switched to on. If so, switch to off and ensure you set date, time and time zone manually and correctly.
    Power off the device (hold sleep button for four seconds, then slide to power off), then power back on.
    If issue persists, switch Set automatically back to on, and if not resolved then restore the device.

  • HT201317 My photostream in windows 7 PC does not shows any pic. when i click on slide show it start showing me slide shows of pic but when i try to copy files i cant do as no photo is viewd in list mode. This problem has arised since IOS is updated.

    My photostream in windows 7 PC does not shows any pic. when i click on slide show it start showing me slide shows of pic but when i try to copy files i cant do as no photo is viewd in list mode. This problem has arised since IOS is updated.I reinstalled my icloud and checked if icloud sharing is ON. I can see pic in my photo stream in PC only in slide show mode. While in list mode it shows pics before i actually click on photostream folder. My phone memory is out becose of bunch of photoes. How do i copy my photostream photoes.

    Hi all.  I can’t tell you how to solve your iCloud 3.x issues.  Heck, I don’t think they’re even solvable.
    But if you had a previous version of iCloud that was working correctly then I can definitely tell you how to solve the “iCloud Photo Stream is not syncing correctly to my Windows 7 PC” problem.  …without even a re-boot.
    Log out of iCloud 3.0 and uninstall it.
    Open My Computer and then open your C:\ drive.  Go to Tools/Folder Options and click on the View tab.  Select the “Show hidden…” radio button and click on OK.
    Open the Users folder.
    Open your user folder
    Open ProgramData (previously hidden folder)
    Open the Apple folder – not the Apple Computer folder.
    Open the Installer Cache folder
    In Details view sort on Name
    Open the folder for the newest entry for iCloud Control Panel 2.x – probably 2.1.2.8 dated 4/25/2013
    Right click on iCloud64.msi and select Install.
    When finished, the synching between iCloud and your PC will be back to working perfectly as before the 3.0 fiasco.  The pictures will be synched to the same Photostream folder as before the “upgrade”.  Now all you need to do is wait until Apple/Microsoft get this thing fixed and working before you try the 3.x upgrade again.
    I think the iCloud 3.0 software was written by the same folks who wrote healthcare.gov with the main difference being that healthcare.gov might eventually be made to work.
    For those of you who hate to go backwards, think of it as attacking to the rear.  Which would you rather have, the frustration of no synching or everything working on an older version?
    Good luck…

  • I have downloaded latest itunes but my ipad does not show in devices when I try to sync.  Any suggestions?

    I have just gotten my new ipad!!!  I downloaded latest version of itunes but my ipad does not show in devices when I try to sync music.  Any suggestions??

    Does a little box come up seeing the iPad as a camera? That doesn't impact iTunes as much as it confirms that your computer sees the device. If your computer doesn't see it then iTunes doesn't know it's there.
    If you're plugged into a hub or extender, try plugging it directly into the box or main part of your computer.
    If you're using an extension, stop and just use the included sync cable.
    Try using a different USB port.
    After you installed iTunes, did you restart your computer?
    Usually what's needed is the 'apple device driver' which installs automatically, you just need to sometimes trigger the install, using different ports helps with that.
    If the simple trouble shooting doesn't help then you can search on the Apple Device Driver and there's more detailed trouble shooting on the site.

  • My Ipod does not show in Itunes, when I connect it shows for a second a disappears again, I have gone through the trouble shooting but no luck?

    My Ipod does not show in Itunes, when I connect it shows for a second a disappears again, I have gone through the trouble shooting but no luck?

    :-) the problem is solved. Thanks to a great typ in one of the other discussions with alt+cmd+S iTunes looks again like something I recognize. After removing the iPod from iMac and also from the connecting "holder", turning it on ad off, rebooting the iMac, maggic happens and the iPod now shows in iTunes and everything works just fine.

  • TS3694 i think itunes  has removed my iphone software. because now not showing home screen. when i tried to restore my phone there generated an error no is 1015. please help me how can i recover my iphone again?

    i think itunes  has removed my iphone software. because now not showing home screen. when i tried to restore my phone there generated an error no is 1015. please help me how can i recover my iphone again?

    From the article which you posted your question from:
    Errors related to downgrading iOS
    The required resource cannot be found: This alert message occurs when your device has a newer version of iOS than what is available in iTunes. When troubleshooting a device that presents this alert message, go to Settings > General > About and check the version of iOS on the device. If it is newer than the latest released iOS version, the device may have a prerelease developer version of iOS installed.   Installing an older version of iOS over a newer version is not supported.
    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.

  • My 2nd generation ipod will not show on itunes when connected

    my 2 nd generation ipod does not show on itunes when connected

    Start here:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows

  • Ipod 1 Gen does not show in itune when others will

    Ipod 1 Gen does not show in itune when others will

    What have you tried so far in terms of troubleshooting this issue?  Are you plugging the iPod into a high powered USB 2.0 port on the back of your PC? Have you tried a different USB cable?
    What happens if you try to reset the device with it still connected to the PC?
    How to reset iPod
    Has this iPod ever worked on this PC or is this the first time you have time you have tried connecting it?
    Have you carefully worked through each and every single suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • My ibook author is not showing preview and when i click preview it is saying ibook not installed even though i have latest ibook installed on my ipad mini and i am on ios 8

    my ibook author is not showing preview and when i click preview it is saying ibook not installed even though i have latest ibook installed on my ipad mini and i am on ios 8 can any one please suggest something

    What happens when you click the "Download" button for Mountain Lion? Do you get any response (error messages, etc.) from the Mac App Store?
    Clinton

  • Af:table shows horizontal scroll when embedded in a region

    I added a af:table in a jsff file which has 5 columns into a region. Even if the rows are empty, the horizontal bar is shown. I tried changing the width and/or styleClass attribute of the table and there is no change. I tried adding panelStrechLayout/panelCollection without any success.
    Can you please let me know how to avoid the horizontal bar of the table.

    The contents of the jsff file is as follows and this jsff file is added as a region.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
    <af:panelCollection id="pc1" featuresOff="wrap">
    <af:table var="row" rowBandingInterval="0" id="sqlMon"
    summary="SQL Monitor"
    emptyText="No Data Found"
    disableColumnReordering="true"
    value="#{dbHomePageSQLMonitorBean.tableList}"
    >
    <af:column sortable="false" headerText="Duration" id="c5"
    >
    <af:spacer id="spr4" width="#{row.durationPX}" height="10px"
    shortDesc="#{row.durationDesc}"
    inlineStyle="background-color:Grey;"/>
    </af:column>
    <af:column sortable="false" headerText="SQL ID" id="c1"
    noWrap="true" >
    <af:outputText value="#{row.sql_id}" id="ot4"/>
    </af:column>
    <af:column sortable="false" headerText="Session" id="c4"
    >
    <af:outputText value="#{row.session_id}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="Parallel " id="c3"
    noWrap="true">
    <af:panelGroupLayout id="pgl1">
    <af:image id="inst" source="/images/database/rac/dbcluster.gif"
    shortDesc="Instance Count"/>
    <af:outputText value="#{row.inst_count}" id="ot3"/>
    <af:spacer width="10" />
    <af:image id="nodes" source="/images/database/rac/dbcluster.gif"
    shortDesc="Degree of parallelism"/>
    <af:outputText value="#{row.dop}" id="ot31"/>
    </af:panelGroupLayout>
    </af:column>
    <af:column sortable="false" headerText="Database Time" id="c2"
    >
    <af:panelGroupLayout id="mg1" >
    <af:spacer id="spr1" width="#{row.cpuWidthPX}" height="10px"
    shortDesc="#{row.cpuDesc}"
    inlineStyle="background-color:Lime;"/>
    <af:spacer id="spr2" width="#{row.userIOWidthPX}" height="10px"
    shortDesc="#{row.userDesc}"
    inlineStyle="background-color:Yellow;"/>
    <af:spacer id="spr3" width="#{row.otherWidthPX}" height="10px"
    shortDesc="#{row.otherDesc}"
    inlineStyle="background-color:Orange;"/>
    </af:panelGroupLayout>
    </af:column>
    </af:table>
    </af:panelCollection>
    </jsp:root>

  • Af:statusIndicator does not show busy icon when a command button is click

    Hi Guys,
    af:statusIndicator does not show busy icon or motion when a command button is click
    I am working on an excel data upload functionality on .jspx page. I use “af:inputFile” file uploader to upload an excel file then process the data and store it as a list of objects in memory and display it in “af:table” table
    I added “af:statusIndicator” to the page to show the user that the page is progressing while the data is uploading and when it is saving the data to the database.
    In this case, when the “af:inputFile” is clicked to upload the excel file - the status indicator shows a progress icon (movement) which is expected and is good. However, after the data have been display in the table when I click on a command button that saves the data to the database – I expected the status indicator to start its busy motion but that is not happening. Whereas, the command button grayed out and is disable when I clicked the button until the operation is completed.
    Is there any way to start the statusIndicator when a command button is clicked?
    I tried the following options
    *<af:statusIndicator id="si1_uploadStatus" partialTriggers="pc1:cb1 pc1:table"/>*
    Where pc1:cb1 is the command button and pc1:table is the table
    *<af:commandButton text="Submit Uploads" id="cb1"*
    *disabled="#{!viewScope.batchUploadController.allSavable}"*
    *partialTriggers="::infFilePath"*
    *action="#{viewScope.batchUploadController.saveUploadedData}"*
    *blocking="true"/>*
    Thanks,

    Can somebody please address this?
    Thanks,

  • My apple TV will not show my iPhotos travel photos in sequence. I set up a sequence of photos that STAY in sequence when viewing in iPhoto on my iMac, but they do not show in sequence when my Apple TV shows them on my TV screen. My Apple TV is MC 572C/A

    My Apple TV will not show my photos in iPhoto on my iMac in the same sequence of images that I can see when viewing the iPhoto photos on my iMac. This is especially frustrating when I try to show my travel pictures in sequence on my TV. I have to resort to showing them on my iMac which defeats the principle purpose for purchasing my MacTV. Does anyone have a solution?
    My Apple TV is Model MC 572C/A and the software is 5.2.1 (6025)
    My iMac is Mac OSX version 10.7.5
    THANKS!
    Doug May

    I can't recall whether slideshows are ordered by title or date, but you can manually re-arrange the albums in iPhoto, then batch change them once you have the order you want.

  • Some images not showing on ipad when book is previewed

    When I preview the book in progress, some images only appear in the thumbnails, not on the full page view. These same images were showing up a few versions ago.  Other images are showing up just fine.

    Hi KT and Anyone Else Who Could Help,
    One thing I noticed is the images that are not showing up are all captioned, but with background shut off. I have a few image galleries as well, but those ARE showing up.
    Some images are jpegs, others are pngs, but there is no pattern or correlation between image type and showing up, not showing up.
    Besides, they all showed up previously.
    So I removed the caption from one image and now it is showing up!
    But I am nearly certain that in an earlier version WITH captions, they all showed, and I would like to keep the captions.
    Any ideas?
    Thanks so much!
    Belinda

Maybe you are looking for

  • Applications open and close without really starting

    Often, when I download a 3rd party program (yes, I know, 3rd party, not supported, bear with me) and then try and run it, the program will appear in dock, bounce once or twice, the black triangle will appear and suddenly the program will just close a

  • Dv7 Laptop won't run on battery

    Laptop Data: [Image Removed] Upon unplugging my laptop last night, it simply shut off, and since won't run off of the battery. It seems like the battery isn't connecting to the motherboard, but I ran a test in the support assistant that gives me this

  • Snow Leopard Mail Signature Files Still Not Showing Inline

    I was hoping Snow Leopard's mail would fix my signature file being added as an attachment rather than appearing inline in the message as you'd expect. Any ideas or anybody found a way to get the signature file to actually appear with the mail text? (

  • CS4 Crash

    I have had a problem with CS4 crashing.  It does not happen at the same point of operation but it does it often.  I thought I had resolved this problem recently when I discovered corrupted RAM I have replaced it.  Here is the latest crash report. Any

  • After installing version 11.3.1, saying itunes has stopped working

    Accepted update to version 11.3.1 this week and now can't get iTunes to work. It starts up, shows the interface and then promptly a message saying iTunes has stopped working is displayed by Windows X64 and it tries to search for a solution to the pro