How to scroll panels using scrollpane?

i am having two panels containing different images in a main panel.
my problem is that due to big size only one panel is visible in run time so i want to add scrollbar to the main panel.
i have used scrollpane for the main panel but i am getting confused that at which event i should put the code of repainting the visible area.
can anybody tell me how to implement this.
plz... help

gaurav_mishra wrote:
actually i am working in netbeans so i don't know where is the paint method of the panel.can anybody plz help me get rid of this problemApparently we were all mistaken by your description, it looked like you were writing a custom JPanel subclass, with a custom paintComponent() method that would draw the images...
I don't know how you display images in a Panel with NetBeans, but presumably it re-uses some existing JComponent and it doesn't have to generate a paintComponent() method.
At that step you should consider the very first reply: please post some code, the shortest running example that demonstrates your problem.
If you're reluctant, try a simple scroll example: put a single JButton in a JPanel with a FlowLayout, using an image as the button's icon. Stuff this panel into a JScrollPane, itslef in a JFrame, run the app and resize the JFrame. Check whether the button displays appropriately. If it does, try to check what's different with your problematic case.
I like NetBeans (or merely, NetBeans's GUI designer), but it's not the best way to learn Swing programming, which looks like what you're doing.

Similar Messages

  • Updates to Folio Panel, Producer Tools and Content Viewer on iPad breaking scroll panels

    This has not been a good morning.
    Came into the office this morning, logged in and saw that there were updates for the Content Viewer, Producer Tools and the Folio Panel. Updated them all. Started to work some more on a promo piece for a new magazine and began to notice Scroll Panels using the "Pan Only" form within the Content Overlay panel no longer work. This was a great way to create scroll panels that could contain hyperlinks. Problem is, I am not sure where the problem lies. Is the problem with the Viewer or with the updates to the Folio Tools or Folio Panel? I am unfortunately on deadline for this afternoon and I don't have the luxury to troubleshoot this. Granted, I probably shouldn't have updated all of these tools at this juncture, but I was hoping that these updates would fix the problem I was having with the Desktop Viewer that wasn't working. Sadly, the Desktop Viewer works now, but that came with the price of losing functionality elsewhere.
    Frustrated.

    Yeah, it's been a project that I was working on for the last two weeks. We were supposed to have a final walk-through this afternoon and present it tomorrow. But now a good portion of the features that were working and had been promised no longer work. All out of no fault of my own. I understand that these things can happen, but this one is pretty bad and the timing was worse. Like I said, I shouldn't have updated the tools and the Viewer app until after the presentation... but then again, that may have been even worse. At least I was able to get the presentation postponed until Monday... gives me a little more time to figure out what to do.
    Anyways, I did able to get a hold of someone through support and was able to send them some files. It's being looked at as I type this. I do have to give credit to the Adobe support staff, they've been helpful and pretty responsive! Thanks guys!

  • FAQ: How do I create a scrolling panel in Flash Catalyst?

    A common challenge in web design is finding space in the available window to display all of the necessary content. One solution is to create scrolling panels. A panel creates a well-defined container for content in the user interface. By adding scrolling content and a scroll bar, you can place a large amount of information in a limited space. To create a scrolling panel in Flash Catalyst, you need:
    An object to define the panel area, such as a rectangle shape (optional)
    Scrolling content, such as a long block of text or a series of images (required)
    A scroll bar used to scroll the content (recommended)
    Follow these steps in Flash Catalyst Help to create a scrolling panel:
    Create a scroll panel component
    There are also video tutorials showing examples of different scrolling panels:
    Creating a scroll panel in Flash Catalyst, by Doug Winnie
    Create a scrolling text panel in Flash Catalyst, by Terry White

    Thank You, Thank You,
    Thaqnk You
    Allen D. Macfalda

  • How do I get my phone out of voice control and can not scroll or use it

    How do I get my phone out of voice control and can not scroll or use it?

    press the home button and hold it for a few seconds. Voice conrol will appear

  • Using Scroll Panel

    Hello everyone!!
    I try to work with scroll panel putting some text on it.What
    I did is creating one swf file that contains the text and in
    another swf I put the scroll panel.The problem is that I cannot see
    the whole text I wrote and when the scroller is at the middle my
    text is cut.
    You can check what I mean on www.apositive.com in the news
    section
    I am using flash 8
    Thanks in advance!!

    quote:
    Originally posted by:
    fojool-br
    If quilting stitch is like that one of http: //
    www.apositive.gr new you to create a field of dynamic text and to
    put a name in instance name, drag the component UIScrollBar up to
    pulling in on the field of text, see in the properties of the
    ScrolBar that he will be going to catch the name of the field of
    text if he links if it will adjust to the size of the field of text
    this one done it is enough to put his text inside the field of text
    Thanks
    I tried that but I couldn't maintain the format of the text I
    already have.I mean make it a dynamic text it colors all the fonts
    the same and puts the same font everywhere

  • Adding panels to scrollpane

    I want to include panels dynamically into the scroll pane. Which layout should I select for this ? I read that for scroll panes, only ScrollPaneLayout can be used, but it does not work for my application. Can anyone tell me please how do I add the panels to it ? The code I m using is as follows:
    jScrollPaneMain.setLayout(new ScrollPaneLayout());
    jScrollPaneMain.add(jPanel1);
    jScrollPaneMain.revalidate();
    jScrollPaneMain.repaint(); 

    Make an intermediate panel:
    JPanel intermediate = new JPanel();
    scrollPane.setViewportView(intermediate);and then:
    intermediate.add(panel1);
    intermediate.add(panel2);The layout for the intermediate panel could be a GridLayout, GridBagLayout or a GroupLayout. Depending on how the added panels have to behave.

  • Integrated scroll panels and unmovable toggle buttons

    Hey,
    iam looking for an expert. I am working on an HMI development and wanted to use Flash Catalyst. However, I think I am already reached the limits of FC. But perhaps there is a FC solution because I can not program Flash.
    Problem:
    In my layer, I have different graphical objects and text blocks. A part of them I want to move with a scroll panel. That's easy, not a problem.
    However, all these objects (including the scroll panels) should be integrated in a master scroll panel. This means, that all parts, even the integrated scroll panels, should be moveable at the same time. I managed this.
    Now, I need multiple toggle buttons. With these Buttons I wanted to change the form of some of the graphical objects resp. the text blocks. But the buttons have to be unmovable. This function (to change the form of the objects) is relatively easy but in combination with the integrated scroll panels it isnt. The buttons are able to move the objects when these buttons are pasted in the "deepest" layer, the layer of the objects. But there, the buttons are moveable and slide out of the screen (with the master scroll panel) and not clickable.
    How can I manage this? I need unmovable toggle buttons, with these I want to change the forms of objects. The objects are pasted in integrated scroll panels. I hope it's understandable!
    Can someone help me? It would be glad if the answer does not depend on the learning of the flash programming!
    Thanks.

    After 2 days of banging my head against a wall (doesn't it always go that way)...
    Turns out one of my panels had sub-panels causing the problem. Visibility to the parent panel was controlled by a button on one of the child panels. Once I "promoted" the button to the parent panel, the panel (screen) flow worked great.
    Is this 'undocumented functionality'? Why should it matter how deep the button is nested? (incidentally, the reason it worked in my test environment was the lack of other components - aka the child panel)
    Well, regardless. Thanks to those who gave it thought.

  • Scroll panel easing?

    I have seen a few examples of creating a scroll panel in Illustrator/Photoshop and then making it functional in Catalyst but I am just curious, is there a way to add easing to the scroll in Catalyst? You know so it speeds up and/or slows down as you scroll?

    Thanks, you answered my main question of "can it be done in catalyst?" On one hand I was pretty sure you couldn't but on the other hand, designers like me think to themselves....why not? You can control the transition and easing of other states, why not this? In other words as Catalyst evolves, to me, it seems like having easing control over just about any animation or anything you interact with (such as a scroll panel) would be standard, keeping up with todays sites.
    I appreciate the extra step you went with giving me the code, but was hoping to not have to go there, especially since thats what catalyst was shooting for. I do use flash cs4, and use a combination of timeline animation and actionscript, but my actionscropt knowledge is VERY minor. I usually use snippets of code from other sources, and tweak it if I can. Usually taking me a long time to figure out how to tweak it to my needs.
    Again, thanks for the reply.

  • How to scroll the JTable to see all the cells in the row?

    Hi,
    I am using JTable and I want to scroll through the cells so that I can see all the cells in the JTable.
    Please help me.
    Sharma

    Hi,
    You can see the example that i am sending with this .
    import javax.swing.*;
    import javax.swing.table.*;
    public class ScrollTable
         public static void main(String[] args)
                   TableModel dataModel = new AbstractTableModel()
                                  public int getColumnCount()
                                  { return 100; }
                             public int getRowCount()
                                  { return 10;}
                             public Object getValueAt(int row, int col)
                                  return new Integer(row*col);
                   JTable table = new JTable(dataModel);
                   JScrollPane scrollpane = new JScrollPane(table);
                   scrollpane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
                   table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                   JFrame frame = new JFrame();
                   JPanel panel = new JPanel();
                   panel.add(scrollpane);
                   frame.getContentPane().add(panel);
                   frame.setSize(300,300);
                   frame.setVisible(true);
    Hope this helps you.
    Deepak

  • Why am I getting the flag Invalid URL for web content overlay when making scrolling panel in Indesig

    Why am I getting the flag 'Invalid URL for web content overlay" when making scrolling panel in Indesign? Iam making additions to existing articles but the problem is new. The articles were originally made using CS and now I am on CC, which I have just uninstalled and re installed, no difference, can anyone help please? Steve

    Hi Bob, thankyou very much for coming back on this. The flag is coming up towards the end of the preview process on desk top. I have made dozens if not hundreds on my two published apps on the app store, but have not done an update for nearly a year, in which time I have needed a refresher, and as usual went to Lynda. In this case I have followed to the letter your DPS course, which is great, and I found the process of making the scrolling panels somewhat easier than when I started 2-3years ago. Initially I was mystified that the flag talked about url and web content, but just put it down to something I had missed in recent improvements in CC.
    I tried over and over, but always got the same result. I thought at one point it might be because the content of my slide was copy and photo, so for a test I deleted the photo. Same result, and many of my existing slides are copy and picture.
    I also uninstalled Indesign CC and reinstalled in case of corrupted content, I also copied to IDML and relaunch, same problem. I am sure I have made the scrolling content as instructed, The one thing I havn't done is trash my preferences, if you think that would be a good Idea could you please direct me to some content at Lynda on how to do it in CC. Many thanks, Steve

  • Dual scroll panels help!

    I used Flash Catalyst CS5.5 to create a feature with two links to popup windows that had scroll panels for text only (with a background). I was able to get the popups to function properly and the text scroll panels to function properly.
    Problem One: After publishing both projects and uploading, they are utilizing the same text. I tried putting one in a subdirectory, but that didn't work. What files can I rename to run both panels in the same directory?
    Problem Two: My panels both have cut off the text... how can I add it back? Is there a simple way to do that?
    I know this is probably an easy problem but Flash is new to me. Any help would be great!
    This is the page I'm working on:
    http://www.parkcity-dogtown.com/press.htm

    OK. I figured out how to separate the filenames. Thanks everyone for your help
    Now I need to edit the swf files to add text... Any help would be appreciated...

  • How do i calculate the scrollpane value

    hi all, how do i calculate the scrollpane value dynamically?
    thanks a lot

    hi sorry for the lousy information, because i was in the hurry.
    hm... should be describe in this way, in VB i know how to get the value of scrollbar when the scrollbar being scroll, but i do not know how to done it in JAVA.
    i have my sample code as following:
            sp.addComponentListener(new ComponentAdapter() {
                public void scrolled(ComponentEvent evt) {
                    width = getWidth();
                    height = getHeight();
            });any idea? izzit correct? it just show nothing while i use to print at console

  • How can 2 people use itunes in the same household? we both have iphone 4 and separate id but the same itunes? pleasehelp

           how can two people use itunes in the same household? i had a iphone before so alreday had an itunes account now me and my husband have upgraded and we now both have them. he has set up a username and i have mine yet when he logs in he seems to just get my account? please help

    Decide which iPhone will be keeping the current iCloud account.  On the one that will be changing accounts, if you have any photos in photo stream that are not in your camera roll or backed up somewhere else save these to your camera roll by opening the photo stream album in the thumbnail view, tapping Edit, then tap all the photos you want to save, tap Share and tap Save to Camera Roll.  If you are syncing Notes with iCloud, you'll also have to email your notes to yourself so they can be recreated in the new account as they cannot be migrated.
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, be sure to select Keep On My iPhone.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.
    Finally, to un-merge the data you will then have to go to icloud.com on your computer and sign into each iCloud account separately and manually delete the data you don't want (such as deleting your wife's data from your account, and vice versa).

  • How can i make my scrollpane in a way that at the opening of a frame it doe

    How can i make my scrollpane in a way that at the opening of a frame it does not scroll down automatically?
    code is below
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import javax.swing.JOptionPane.*;
    import java.io.*;
    import javax.swing.colorchooser.*;
    import javax.swing.filechooser.*;
    import javax.accessibility.*;
    import javax.swing.border.*;
    import java.sql.*;
    public class Signup extends JFrame
         JLabel p1,p2,p3,p4,p5,p6,uid,upass,cpass,fname,sname,hint,sl,ed,age,adr,cit,zip;
         JTextField uname,fnamet,snamet,hintt,adrt,adrt1,city,zipcode;
         JPasswordField upassw,cpassw;     
         JComboBox sex,education,agegr;
         Signup()
         Container c=getContentPane();
         c.setLayout(null);
         c.setBackground(Color.white);
         /** JPanel c = new JPanel();
         c.setBackground(Color.white);
         int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
         int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
         JScrollPane jsp = new JScrollPane(c, v, h); ***/
    p1=new JLabel("Create Your Icafe!ID",10);
         p2=new JLabel("Personal Information");
         p3=new JLabel("User Address");
         p4=new JLabel("Tell Us About Your Hobbiess (Optional) ");
         p5=new JLabel("Tell us something about what you like. This will help us choose the kind of content to display on           your pages.");
         p6=new JLabel("--------------------------------------------------------------------------------");
    uid=new JLabel("User Id");
         upass=new JLabel("Password");
         cpass=new JLabel("Confirmation Password");
         fname=new JLabel("UserName");
         sname=new JLabel("SurName");
         hint=new JLabel("Hint Question");
    sl=new JLabel("Sex");
         ed=new JLabel("Education");     
         age=new JLabel("Age Group");     
         adr=new JLabel("Address");
    cit=new JLabel("City");
    zip=new JLabel("ZipCode");
         uname=new JTextField(10);
         uname.requestFocus();     
         uname.setToolTipText("UserName");
    upassw=new JPasswordField(10);
         upassw.setToolTipText("Password");
         upassw.setEchoChar('*');
         cpassw=new JPasswordField(10);
         cpassw.setToolTipText("Confirmation Password");
         cpassw.setEchoChar('*');
         fnamet=new JTextField(10);
         fnamet.setToolTipText("FullName");
         snamet=new JTextField(10);
         snamet.setToolTipText("SurName");
         hintt=new JTextField(10);
         hintt.setToolTipText("Hint Question");     
    String[] gender={"[Select one]","Male","Female"};
         sex = new JComboBox(gender);          
    String[] edu={"[Select one]","S.S.C","Inter","Graduate","Post Graduate"};
         education= new JComboBox(edu);     
    String[] ageg={"[Select one]","0 - 15","16 - 35","36 - 70","70 - 100"};
         agegr= new JComboBox(ageg);     
    adrt=new JTextField(15);
         adrt.setToolTipText("Address");
         adrt1=new JTextField(15);
         adrt1.setToolTipText("Address");
         city=new JTextField(15);
         city.setToolTipText("City");
    zipcode=new JTextField(15);
         zipcode.setToolTipText("ZipCode");
         p1.setBounds(200,70,160,30);
         uid.setBounds(350,100,160,30);
         uname.setBounds(400,100,160,30);
         upass.setBounds(335,140,160,30);
         upassw.setBounds(400,140,160,30);
         cpass.setBounds(260,180,160,30);
         cpassw.setBounds(400,180,160,30);
         p2.setBounds(200,220,160,30);
         fname.setBounds(330,260,160,30);
         fnamet.setBounds(400,260,160,30);
         sname.setBounds(335,300,160,30);
         snamet.setBounds(400,300,160,30);
    hint.setBounds(315,340,160,30);     
    hintt.setBounds(400,340,160,30);
         sl.setBounds(370,380,160,30);     
         sex.setBounds(400,380,160,30);
         ed.setBounds(335,420,160,30);     
         education.setBounds(400,420,160,30);
    age.setBounds(330,460,160,30);
    agegr.setBounds(400,460,160,30);
    p3.setBounds(200,500,160,30);
         adr.setBounds(340,540,160,30);
         adrt.setBounds(400,540,160,30);
         adrt1.setBounds(400,580,160,30);
         cit.setBounds(370,620,160,30);
         city.setBounds(400,620,160,30);
    zip.setBounds(590,620,160,30);
    zipcode.setBounds(640,620,160,30);
         Font font = new Font("SansSerif",Font.BOLD, 12);
         setFont(font);
         c.add(p1);
    c.add(uid);
         c.add(uname);     
         c.add(upass);
         c.add(upassw);
    c.add(cpass);
         c.add(cpassw);
    c.add(p2);
    c.add(fname);     
         c.add(fnamet);
    c.add(sname);
    c.add(snamet);
         c.add(hint);
    c.add(hintt);     
    c.add(sl);
    c.add(sex);
    c.add(ed);
         c.add(education);
    c.add(age);
         c.add(agegr);
    c.add(p3);
    c.add(adr);
         c.add(adrt);
         c.add(adrt1);
    c.add(cit);
    c.add(city);
    c.add(zip);
    c.add(zipcode);
         setResizable(false);
         //int a=DO_NOTHING_ON_CLOSE;
         //setDefaultCloseOperation(a);
         show();
         setSize(800,500);
    // Border raisedBorder = new BevelBorder(BevelBorder.RAISED);     
         setContentPane(c);     
    public static void main (String arg[])
         try{
         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
         }catch(Exception s)
         Signup swu=new Signup();

    just try the following:
    jsp.getVerticalScrollbar().setValue(0);after inserting and adding all your components. this will set the vertical scrollbar up to the very first line.
    regards

  • I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    Hi kamfong,
    Went to Settings where?
    If you want to use your exisiting Apple ID on your iPad, you need to:
    1.     Go to Settings>iTunes & App Store and sign out the new ID, and then sign on the old one
    2.     Go to Settings>iCloud, scroll to the bottom and delete the iCloud account, and the sign back onto iCloud using the old ID
    You still have not indindated why you are saying that using your old ID originally "didn't work". What do you mean by that? Did you get some sort of error when you tried to sign on with your exisiting Apple ID?
    Cheers,
    GB

Maybe you are looking for