Panle scrollabel

I posted in the Java programming forum but was suggested I post here instead. I am trying to work out how to make a panel so it has a scroll bar. I was told that you add a jpanel to a JScrollPane but it doesn't seem to work.
I have created a simple program to test it out and when I resize the window no scroll bar appears. Can someone run my code and have a look for me? Any simple example would be greatly appreciated
llPane1.setBounds(40, 30, 360, 310);
        pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
        System.exit(0);
    public static void main(String args[]) {
        new scroll().setVisible(true);
    private javax.swing.JButton cancelButton;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton okButton;
}

well I have made a few changes and now a scroll bar always appears but it doesn't work! Can someone run my code below and tell me what I'm doing wrong. Would be much appreciated.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
public class scroll2 extends javax.swing.JFrame {
    /** Creates new form scroll */
    public scroll2() {
        initComponents();
          setSize(590,480);
    private void initComponents() {
        jScrollPane1 = new javax.swing.JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
        jPanel1 = new javax.swing.JPanel();
        okButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
        jPanel1.setLayout(null);
        okButton.setText("ok");
        jPanel1.add(okButton);
        okButton.setBounds(50, 20, 48, 26);
        cancelButton.setText("cancel");
        jPanel1.add(cancelButton);
        cancelButton.setBounds(210, 210, 72, 26);
        jScrollPane1.setViewportView(jPanel1);
        getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
        pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
        System.exit(0);
    public static void main(String args[]) {
        new scroll2().show();
    private javax.swing.JButton cancelButton;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton okButton;
}

Similar Messages

  • Spry tabbed panles default hide

    Hello,
    Im with some problems with the spry content tab. What I need is to:
    as default hide the content of the spry tabbed panels and also hide on mouse out
    please advise if you needto check my codes and site
    thanks

    I see that time has passed and you have not gotten a response to your question.
    What exactly is to be hidden when the mouse is not hovering; what is to be showing when the mouse IS hovering?
    It is possible that the solution will not be to use Spry Tabbed Panels, which would require a lot of adapting.
    For a simple solution, if you don't mind the "contents" to be lined up next to each other, float divs next to each other. Set a height that encompasses your title but make the overflow: hidden. Add a css style that makes overflow: visible;
    Here is some simple code for that:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    .change {
              float: left;
              height: 2.5em;
              width: 100px;
              overflow: hidden;
    .change:hover {
              overflow: visible;
    </style>
    </head>
    <body><div class="change"><h3>Title</h3>
    <p>Here is a basic element</p></div>
    <div class="change"><h3>Title</h3>
    <p>Here is a basic element</p></div>
    <div class="change"><h3>Title</h3>
    <p>Here is a basic element</p></div>
    <div class="change"><h3>Title</h3>
    <p>Here is a basic element</p></div></body>
    </html>
    I fiddled around a bit with the tabbed panels, but couldn't find an easy way to make them appear and disappear on hover.
    Your other possibility is to do disjoint rollovers using the Show-Hide behavior, but it seems difficult to have the "content" start out invisible.
    I hope you have solved the problem by now, or that these suggestions give you some ideas.
    Beth

  • Tabbed Panel Glitch in panles 3 & 4

    One problem with the Tabbed panels I am not sure how to
    address is the registration jumps a bit in Panel 3 & 4.
    It jumps up a few pixels in IE 6 nut is OK in Mozilla. Any
    suggestions or a work around would be greatly appreciated.

    Don't know what you mean V1 but I solved the problem.
    It was sloppy coding on my part. I had <p> tags on
    image paths in the offending panels. Once I removed them it solved
    the problem.
    Thank you for prompting me to have a second look.

  • JTable: scrollabel Cell

    Hi,
    I've already come up with this, but up to now I haven't received any answer.
    What do I have to do, to can I scroll a non editable cell within a JTable?
    Besides the CellRenderer, I have to implement the CellEditor. But I something is wrong, it just won't work.
    code snippet from celleditor:
    public class ScrollPaneCellEditor extends JScrollPane implements TableCellEditor, Serializable{
    JEditorPane pane;
    JScrollPane scrollpane;
    StringBuffer sb;
    /** Creates a new instance of IconTableCellRenderer */
    public ScrollPaneCellEditor() {      
    pane = new JEditorPane();
    sb = new StringBuffer(); }
    public boolean isCellEditable(java.util.EventObject anEvent) {
    return false;
    public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, Object value, boolean isSelected, int row, int column) {
    pane.setText(value.toString());
    super.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    JViewport vp = new JViewport();
    vp.setScrollMode(JViewport.BLIT_SCROLL_MODE);
    vp.setView(pane);
    super.setWheelScrollingEnabled(true);
    if (isSelected){           
    scrollpane.setViewport(vp);
    if(hasFocus()){
    scrollpane.setViewportView(vp);
    super.add(vp);
    return this;
    Best regards,
    Andi

    Hi bukibu79 ,
    In JTable cells are not a component
    it is a painting using graphics, when you edit a cell this time the editable cell only a component so you cann't edit two cells at a time.
    Another one is suppose you assume that cell are compoents then how can add a single component into two different cells. What actualy do on JTable is , JTable get the component form the renderer and paint this renderer component into the cell's rectangle area and move this component to some non visible area.
    If your table cell is non editable then the editor doesn't work because there are no need to get editor for JTable.

  • Spry Tabbed Panles and forms

    Hi,
    I am having a problem with my code. My goal is to have a unique form across different tabs.
    Basically I want the user to send the entire information clicking only one button that is located outside the tabs.
    My first taught was
    <div>
    <form id="form1">
    <div>
    <input type=""... name=""
    </div>
    <div>
    <input type=""... name=""
    </div>
    </form>
    <input type="button" value="send" onClick="send()"/>
    were send is simply
    function send()
    document.getElementById("form1").submit();
    That code didn’t worked because every time I opened a div in which a part of the form was inserted it performed the form action (specifically it goes to the .php page that collect the information)
    Then I tried
    <div>
    <div>
    <form id="form1">
    <input type=""... name=""
    </form>
    </div>
    <div>
    <form id="form1">
    <input type=""... name=""
    </form>
    </div>
    <input type="button" value="send" onClick="send2()"/>
    Where now the function send2 is
    function send()
    document.getElementById("form1").submit();
    document.getElementById("form2").submit();
    Also this strategy did not worked because was sending only the second (or first i did not remember exactly) form.
    So I ended up switching to a function i found on the net the was collecting all the forms in document to one and post it
    function submitAllDocumentForms() {
    var arrDocForms = document.getElementsByTagName('form');
    var formCollector = document.createElement("form");
    with(formCollector)
    method = "post";
    action = "liveit.php";
    name = "formCollector";
    id = "formCollector";
    for(var ix=0;ix<arrDocForms.length;ix++) {
    appendFormVals2Form(arrDocForms[ix], formCollector);
    document.body.appendChild(formCollector);
    formCollector.submit();
    /* Function: add all elements from ``frmCollectFrom´´ and append them to ``frmCollector´´ before returning ``frmCollector´´*/
    function appendFormVals2Form(frmCollectFrom, frmCollector) {
    var frm = frmCollectFrom.elements;
    for(var ix = 0 ; ix < frm.length ; ix++)
    frmCollector.appendChild(frm[ix]);
    return frmCollector;
    This way worked perfectly but has a visually very bad outcome: when I click send it shows for a fraction of second all the checkboxes (that are present in all the different tabs) at the bottom of the screen.
    At that point I called a second function in the send button that creates a fake div just to push down the horrible checkboxes that were showing. Obviously that creates a scroll bar that resize my page and has an even worse effect.
    Do you have any suggestion?
    Thank you very much, and excuse me for my bad English

    I was able to figure it out by myself.
    I just needed to erase the line
    document.body.appendChild(formCollector);
    in order to not show the the ugly form that was collecting the data from the other forms.

  • A How to turn off auto hide tools/panles

    So Flash 9 has a new feature that is annoying me : it likes
    to auto hide the tools/panels.
    apparently Flash is turning this feature on at at random. I
    realize that I must be accidentally hitting some hot key that turns
    it on, but I can't find how to stop it. It's rather annoying.
    How do I disable the auto-hide for the tools and panels?

    Just go to settings, view, toolbars autohide.

  • Missing loaded text/graphics icon & Panles won't stay open

    Hello,
    I've just upgraded from InDesign CS2 to CS3 and notice that, when I come to place text from another application, the text icon is invisible. I can see its position approximately by observing the rulers, but it's very frustrating not to be able to see the icon to place text accurately on my page. Also, when I come to 're-load' the icon at the end of a column to place the continiung text elsewhere, the loaded icon is invisible, here too!
    Also, I've docked my selected panels to the right of the screen as I had them on CS2. However, I used to be able to keep a panel open before selecting anything on the page. For example, the swatches for changing the colour of text in several places on a page. Now, I have to click an item or select the text first, THEN open the panel each and evey time. Clicking anywhere on the page without selecting anything automatically closed the panel - something that did not happen on CS2. Both of the above make working very arduous.
    Is it me, or is there some setting that's different for these problems with CS3 that was different with the previous version?
    Any help gratefully recieved.
    Chris Cattrall

    Peter - many thanks for your reply. I discovered that the problem was in General Preferences. There is a check box to automatically close panels which, unchecked, allows them to remain open. The other problem was a check box that allowed placed text or graphics to be positioned as a 'thumbnail'. Turning this off brings back the familiar icons for this function.
    Anyway, many thanks again for your help.
    Chris

  • Automating Spry Framework Sliding Panles

    I am trying to figure out the best way to automate spry
    sliding panels to function similar to a slideshow (changing panels
    every few seconds). Can anyone offer some insight on this?

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox.
    [http://forums.mozillazine.org/viewforum.php?f=25]
    You'll need to register and login to be able to post in that forum.

  • Flv missing control panle

    Hi
    I hope someone has the suloution to this because i'm pretty stuck!
    I've placed a movie into my flash website. the controle panel (play stop volume etc.) shows up and works perfectly fine on my local server but once i up load it to the net all those contoles vanish???
    www.videoproductions.ie
    to see what i mean click the above link select WEDDINGS and then select SAMPLES and then select SAMPLE 2 or SAMPLE 3.
    I've tried googleing this with no luck . I would really appericate any help
    thanks
    ana

    There is a second SWF that needs to be uploaded along with your project.
    It is typically named the same as the style controls you chose - so "Clear External All" is ClearExternalAll.swf - and sits right next to your flash file.  Upload it right next to the SWF and it should work fine.

  • Moving pictures panles...or some sorts

    Hi guys/gals,
    I want to create a short video, something like this: I want the camera to pan (hover) from left to right (or down-up) over a panel of different pictures and at the end zoom out and all the pictures transform into a text (a logo actually). It's something like this, actually: http://www.youtube.com/watch?v=yqc9zX04DXs
    Do you know what effect/technique showld I use? On the computer I'm using right now I have installed the Trapcode Suite and that's about it.
    Thank you!
    Cheers!

    Try this. Batch process your photos in photoshop to crop them and size them to just larger than you want them to appear in your video. Let's say 200 X 200. Use the automation features to save them as a numbered sequence, photo_01.png, photo_02.png and so forth.
    Import these into AE as a image sequence, set the frame rate of the image sequence to match your main comp frame rate, then add the image sequence to your timeline.
    Now use Trapcode Form or Particular and use your image sequence as a custom particle. Set the particle to your image sequence, random still frame, adjust the number of particles to match the length of your image sequenc, then follow some of the Trapcode Form or Particular tutorials about moving particles into a logo.

  • Unable to render video in PSCS4 - Error Messages- QT DLL Issue??

    I started this thread in the Adobe Forums for PhotshopCS4, but the consensus there was that my issue is a QuickTime issue, perhaps with a DLL and iTunes. I have included a few of those suggestions at the end of the post. I have tried uninstalling QT Pro, cleaning and reinstalling with no improvement. I have not removed iTunes and reinstalled.
    `````````````````
    I am unable to render video it seems in Photoshop CS4 Extended. Despite having the latest QuickTime Pro installed and all updates to Vista 32 bit and to CS4 Design Premium, I get the following error message:
    "The procedure entry point CFCreateApplicationRepositoryPath could not be located in the data link library CoreFoundation.dll"
    This happens when, for example, I load 100 medium resolution JPEGs as an image sequence and choose File >Export > Render Video.
    If I OK through the error a couple of times I get a screen with output options, but usually some are greyed out. When I CAN put in QuickTime settings and choose export I get the following error:
    "Could not complete the Render Video Command because of a program error."
    When I have opened a support case with Adobe it has regularly been closed after being told to get QuickTime 7.2 or higher. GGGrrrr. I have QT 7.6.5 Pro installed.
    Any help much appreciated....I do have Premiere Elements 7 installed as well FYI.
    Thanks! System Info below:
    Adobe Photoshop Version: 11.0.1 (11.0.1x20090218 [20090218.r.523 2009/02/18:02:00:00 cutoff; r branch])
    Operating System: Windows Vista 32-bit
    Version: 6.0 Service Pack 2
    System architecture: Intel CPU Family:6, Model:15, Stepping:7 with MMX, SSE Integer, SSE FP, SSE2
    Physical processor count: 4
    Processor speed: 2400 MHz
    Video Card Vendor: NVIDIA Corporation
    Video Card Renderer: GeForce 9500 GT/PCI/SSE2
    OpenGL Drawing: Enabled.
    Video Card: NVIDIA GeForce 9500 GT
    Video Mode: 1920 x 1080 x 4294967296 colors
    Video Card Driver: nvd3dum.dll,nvwgf2um.dll,nvwgf2um.dll
    Driver Version: 8.17.11.9562
    Built-in memory: 3070 MB
    Free memory: 1180 MB
    Memory available to Photoshop: 1632 MB
    Memory used by Photoshop: 80 %
    Image cache levels: 4
    Serial number: removed
    Application folder: C:\Program Files\Adobe\Adobe Photoshop CS4\
    Temporary file path: C:\Users\Phil\AppData\Local\Temp\
    Photoshop scratch has async I/O enabled
    Scratch volume(s):
    C:\, 289.2G, 122.5G free
    E:\, 298.1G, 50.0G free
    Primary Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS4\Plug-ins\
    Additional Plug-ins folder: not set
    Was your QT properly installed with correct privileges? As Mr. Cox said, it seems there is an issue with your QT install. also, in the QT system control panle, enable the Allow Encoding using Legacy CoDecs option. this often fixes the weirdest issues (as it also catches a number of other legacy calls to QT components)...
    Mylenium
    Thanks guys- the QT install SEEMS fine....? I will try allowing legacy CODECs and if that doesnt ehlp I will totally uninstall QT Pro, clean the registry, reboot and install QT from the top. Will let you know how I get on with this.
    Phil
    I have enabled using legacy CODECs and restarted, same error message.
    I have completely uninstalled QuickTime(Pro), run CCleaner to clear files and the registry...I have then rebooted, reinstalled Quicktime(Pro) 7.6.5, rebooted. I get the very same error message at that time.
    Any further suggestions appreciated.
    All the google searches point directly at Apple like Chris pointed out. I noticed that there were a lot of Apple product hits but the most standing out was itunes. Did you happen to install itunes software (or some other Apple product) and maybe itunes over-wrote the .DLL? Other then that thought I don't have any other input.
    I agree this is an issue with an Apple DLL. The error you're getting suggests that the wrong version of the DLL is being used. It means that the thing that is rendering the video is expecting the CoreFoundation DLL to have a particular function called CFCreateRepositoryPath but it's not there.
    What could be happening is that there are multiple instances of this DLL on the computer and the PATH is leading to the wrong one.
    You might search your entire hard-drive and find where the CoreFoundation DLL exists and what version each is. If there is only one version, then perhaps your version of QuickTime is actually too new. Photoshop 11.0.1 came out a long time ago, and the version of QuickTime referred to in the support-ticket-closure response is also pretty old, so maybe the newest QuickTime is using a newer version of the DLL that Photoshop knows how to deal with.
    Searching my system for CoreFoundation. there is one smaller version of the DLL in Apple Application Support dated in November and then several larger ones in directories dealing with mobile phones like the iPhone, which I don't have one of, dated a few months earlier.
    I'm guessing the iPhone stuff came with iTunes, which I do have installed, though I don't really use it.
    Thanks for looking, really hoping for some help here.

    "The procedure entry point CFCreateApplicationRepositoryPath could not be located in the data link library CoreFoundation.dll"
    Thanks for all the detailed information, pw. It's very helpful.
    Okay, the most recent versions of QuickTime require a fully functional Apple Application Support in order to run properly. You're getting a problem with one of the Apple Application Support dlls. So the best thing to do first would be to uninstall both Apple Application Support and QuickTime, and then reinstalling QuickTime (which should reinstall a fresh version of Apple Application Support).
    There's 7/Vista 32-bit instructions for doing that in the following post:
    http://discussions.apple.com/thread.jspa?messageID=10760492&#10760492

  • My spry collapsible panel will not open or close

    I've been working on a website in dreamweaver cs5 and im trying to add a collapse panle with  text feild  and submit button to it so people can signup to get more info and be apart of the email list. i have the animation button checked in the properties and the default postion set on closed, but when i go to live veiw or test it on the net it is in the open position and will not animate.... Any help out there....

    Have a look at these samples http://labs.adobe.com/technologies/spry/samples/collapsiblepanel/collapsible_panel_sample. htm
    Gramps

  • Firefox 3.6.10 update won't install and keeps crashing over and over.

    My Firefox downloaded and installed the 3.6.10 update. After restarting it is trying to install the update, but then can't so it crashes/quits. Then it trys to start again and can't install then crash/quit. I'm stuck in a loop. Same thing in Safe Mode. I cannot even use Firefox at this point. Not sure if its related but I started having Flash problems on the 3.6.9 update.

    Ff 3.6.10 is the worst ever piece of software that I have put my hand on for many many years. It is irresponsible of the ff folks to have released this without minimal testing.
    In my case the installer asked me to reboot the system at the end of installation. and I did. After that in every occasion that I click the ff icon it tells me: Your computer must be restarted to complete a previous upgrade of firefox. Do you want to reboot now? If you say no, it just dies away without any joy. Simply no internet.... if you say it reboots, and clicking on the ff icon after the reboot pops up the same message: Your computer must be restarted to complete a previous....
    The painful thing is that the uninstallation via the control Panle's "add and remove programs" also shamelessly pops up the same message with the same never-ending-rebooting process:Your comupter must be restarted to complete....
    This is the worst piece of crap I have ever seen.
    Best regards
    Nasser.

  • How do you create multiple execution windows for a custom opterator interface

    I am starting to create a custom operator interface for TestStand 3.5 using Labview 8.0.  This is my first exposure to custom operator interfaces (and ActiveX).  The example operator interfaces have only one execution window that changes based on the executions combo box.  My sequence is going to be run with the parallel sequence model (2 test sockets).  So I want my custom operator interface to have 2 execution windows, one for each test socket.  How can I do this?  I created a second execution window but it just mirrors the first execution window. 

    Hi, All:
     With the similar approach, I create a multiple window user interface with CVI. Although it can run, the Execution view doesn't display
    anything while execution. In my user interface, there is an applicaiton manager resident in Parent form, and every child forms has
    itsown Exection view and Manager.
     Referred to the C# sample, in the function rivate void DisplayExecution(Execution execution)
       if (executionForm == null) // execution is not in a form, make a new form
        executionForm = new ExecutionForm(this, this.axApplicationMgr, execution);
        this.mChildFormsKeyedByViewMgr.Add(executionForm.GetViewMgr().GetOcx(), executionForm);
        SetNewChildFormLocation(executionForm);
     I guess the execution form "hook" the exectuion view manager via Add(), so the exectuion view can be updated properly.
    And according to reference manual of teststand, it mentions that "The application sets the ExecutionViewMgr.UserData property to
    attach a handle, reference, or pointer that represents the window." But when I try to utilize this method, I got 2 problems:
    1. How to get a window handle of a CVI panel? As execution view are resident in child panels, so I may need the window handle of
     individual child panels.
    2. Even the window hanlde is gotten, how can I convert it to a VARIANT Type? According to the function panle of
    TSUI_ExecutionViewMgrSetUserData (, NULL, ), the last parameter is a "VARIANT".
    Any comments or instructions for my assumption?
    Thank you for your help.

  • I can not create an email account for my client

    I have created an email account ([email protected]) and it is sending snd recieving messages. However when I try to create an address ([email protected]) me client could not log in to the webmail. I deleted the account and re-created the address with my email as the recovery. My thinking was I would set up the email and confirm everything is working and then show the client how to reset the password. Now it I can not get the BC admin panle to send an invite email yo me. Please advise. Client is passed mad on this. I have to resolve this issue.

    When I try to set up the [email protected] email account in the BC admin panle it repeatedly continues to change the password recovery email to [email protected] no matter how I set it up. This doesn't make any sense.  We can get into that account to even set a user password.

Maybe you are looking for

  • How to attach files to the threads?

    Hi all, I m new to SDN.and i dont how to send the files to the threads. can any one please tell me how to attach the files to threads? and also i want post some useful files.please tell me how to post those files? Thanks, Usha

  • Changing the printer cartridges for a HP laserjet 2840

    Having a problem with the wheel not going to the next cartridge...there is a message on the display saying "incorrect yellow" but the yellow cartridge has been taken out and it will not go to the next slot. I am out of warranty and need my printer ca

  • Downloaded 4.0. part of navigation bar missing.

    The reload icon, stop search icon, and home page icon are missing. The previous page arrow, next page arrow, address box, and search box works.

  • Using Lightroom Mobile as travel downloader/editor

    Friends, I'm a new member of the Lightroom family.  I'd like to use Lightroom Mobile while traveling whereby I download RAWs (or RAWs and .jpegs) to my iPad, edit the images on my iPad, then easily sync/transfer those edits to my computer when I get

  • READ_AND_CHECK_ADMIN_PASSWORD

    Hi, I am running the PREPARE phase of the JAVA Stack upgrade,i am getting the below error in the READ_AND_CHECK_ADMIN_PASSWORD Phase #1.#C000AC137F3300000000029F11B211B200046E46300CE868#1247147639761#/System/Server/Upgrade/Dialog##java.lang.Throwable