Scroll Bar Action

Best explained by example:
I have 2000 things of data that I need to populate to a table. This table is being refreshed every 5 seconds. You can imagine the slow down of having to do this. Now, I have method that will allow me to pull out only 25 at a time, and as needed. I want to set up a vertical scroll bar that will allow me to pull out the specific 25 based upon where the scroll bar is at. Like if I scroll half-way, it'll pull out 1000-1025 portions of data. The problem that I'm running into is that I can't get the scrolling to work properly. I've been using the:
m_scrollPane.getVerticalScrollBar().setValues(cur_sel, DATABASE_SPACE, 0, tol_count);tol_count: how many is in the database total
cur_sel: where the scroll bar is at currently
DATABASE_SPACE: how many will populate (for this example, it's 25)
Every time I attempt to scroll, it just resets back to 0, and doesn't even scroll down.
Any and all ideas to help me with this problem would be great! Thanks

Best explained by example:Actually its best explained by posting demo code. We can't tell what is going on based on a single line of code.
I"ve had better luck using table.scrollRectToVisible(...);
If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting.

Similar Messages

  • UPK - Click Scroll bar action not working in Player only

    In the Developer all action areas are working as they should but when I published to the web one action is not working - the Click Scroll bar action in the TryIt mode. When you reach this step and click the scroll bar nothing happens so you are forced to either go forward or back. Any ideas why this is happening? Thank you.

    Hello,
    This does not sound familiar to me, but it sounds like it should be easy to troubleshoot. I would suggest entering a ticket in My Oracle Support (support.oracle.com). Sorry I couldn't be more helpful.
    Best regards,
    Marc

  • Scroll bar actions script issue

    I am having a problem with the action script for a scroll bar
    the code is complex and I did not write it but have managed to make
    other adjustments to get it to work...think we got the wrong raw
    file to work from because the scroll bar works in the file on the
    seller's server. Can't find the programmer now. If someone could
    please tell me what I am missing. The scroll bar works if you use
    the solid scroller in the middle but does not move the information
    and the arrows do not work at all. You can check this out at
    http://74.53.228.34/~jacob753/vocab/
    Just click on crossword and then load a topic and you will
    see that the scroll bar does not work at all. The floating window
    is another issue and I will put this in another message after this
    is fixed.
    The code is below:
    initClueListScroll = function(y){
    // y : hauteur de la cluelist (height of the cluelist)
    _global.clueListHeight = y
    _global.clueListScroll = true
    var c = clScrollClip
    c._x = Math.floor(cluelistClip._x+cluelistClip._width)
    c.scrollBG._height = gridSize*cellSize-40
    c.scrdownClip._y = c.scrollBG._y+c.scrollBG._height
    c.scroller._height =
    c.scrollBG._height*(gridSize*cellSize/y)
    // ---- on définit les actions (action definitions)
    c.scrdownClip.onRollOver = c.scrupClip.onRollOver =
    function(){
    this.gotoAndPlay(2)
    c.scrdownClip.onRollOut = c.scrupClip.onRollOut =
    function(){
    this.gotoAndStop(1)
    c.scrdownClip.onReleaseOutside = c.scrdownClip.onRelease =
    function(){
    this.gotoAndStop(1)
    var c = getMain().clScrollClip
    c.scrollBG.onRelease()
    c.scrupClip.onReleaseOutside = c.scrdownClip.onRelease =
    function(){
    this.gotoAndStop(1)
    var c = getMain().clScrollClip
    c.scrollBG.onRelease()
    c.scroller.onRollOver = function(){
    this.gotoAndStop(2)
    c.scroller.onRollOut = function(){
    this.gotoAndStop(1)
    c.scroller.onPress = function(){
    this.gotoAndStop(2)
    var c = getMain().clScrollClip
    var yMin = c.scrollBG._y
    var yMax =
    c.scrollBG._y+Math.floor(c.scrollBG._height-c.scroller._height)
    this.startDrag(false,0,yMin,0,yMax)
    getMain().onMouseMove = function(){
    var c = getMain().clScrollClip
    var yDes = c.scroller._y-20
    var yMax = Math.floor(c.scrollBG._height-c.scroller._height)
    var yFin = 20+Math.min(yDes,yMax)
    c.scroller.setGoTo(c.scroller._x,yFin,100,c.scroller._yscale,100,0,4)
    var yDiff =
    (yFin-c.scrollBG._y)*(gridSize*cellSize/c.scrollBG._height)
    if(yFin==yMax+20){
    var ymn = 0
    var ymx = clueListHeight-(gridSize*cellSize)
    yDiff = (ymx - ymn)*(yFin/(yMax+20))
    // pX, pY, pW, pH, pA, pR, pSpeed
    var cl = getMain().cluelistClip.contClip
    cl.setGoTo(cl._x,-yDiff+gridPosition.y,100,100,100,0,4)
    c.scroller.onRelease = c.scroller.onReleaseOutside =
    function(){
    stopDrag()
    this.gotoAndStop(1)
    delete getMain().onMouseMove
    c.scrollBG.onRelease = function(){
    var c = getMain().clScrollClip
    var yDes = c._ymouse-20<c.scroller._height ? 0 :
    c._ymouse-20
    var yMax = Math.floor(c.scrollBG._height-c.scroller._height)
    var yFin = 20+Math.min(yDes,yMax)
    c.scroller.setGoTo(c.scroller._x,yFin,100,c.scroller._yscale,100,0,4)
    var yDiff =
    (yFin-c.scrollBG._y)*(gridSize*cellSize/c.scrollBG._height)
    if(yFin==yMax+20){
    var ymn = 0
    var ymx = clueListHeight-(gridSize*cellSize)
    yDiff = (ymx - ymn)*(yFin/(yMax+20))
    // pX, pY, pW, pH, pA, pR, pSpeed
    var cl = getMain().cluelistClip.contClip
    cl.setGoTo(cl._x,-yDiff+gridPosition.y,100,100,100,0,4)
    c.scrollBG.onReleaseOutside = c.scrollBG.onRelease

    Try it in a simple test case.  I don't think that is default behavior.

  • Scroll wheel - Scroll Bar mismatch

    Can I limit the mouse scroll wheel "left/right" and "up/down" so
    that its their actions matches the window's scroll bar actions.

    Something like this?
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Limit-Scrolling-with-wheel-to-Bounds-of-Panel-Diagram/...
    I am not holding my breath... 

  • Was updating ipad on new update.  scroll bar on Ipad no action

    can someone help me?  I was updating the ipad with new software.  some how it was completed but ipad shown apple icon and scroll bar which no action at all.

    First, try to restart the ipad by holding the home and power buttons for ten seconds, until the apple appears and let it restart.
    If it's still frozen, you can try a Restore from within the itunes on your computer.
    It should take about 20 minutes.
    And hopefully you performed a sync just before you updated, or there may be some data loss.
    Let us know.....

  • After applying full scroll bar to the page including header and footer, Text editor ribbon actions cause page to automatically scroll down (while applying formatting)

    After applying full scroll bar to the page including header and footer, I have provided content to
    the page more than 100 lines and try to format the text from ribbon actions(format text area). On mouse over of font or fore color, the control jumps to the highlighted content area and not able to select the color. The page scrolls down and not able to click
    on any action.
    Consider this scenario also.
    A content editor web part is added toward the bottom of the page.
    Text is added to this (direct in the web part, not via a 'content link')
    You highlight some text and go to the Markup Style dropdown...
    Everything is fine until you hover over the "Paragraph" markup style, and suddenly the page scrolls to the web part you are editing, and you didn't have a chance
    to click and apply the "Paragraph" formatting
    I have tried testing this with text typed directly into the Content Editor, text pasted in from somewhere else, and text pasted in from somewhere else using "Paste as
    Plaintext" option in the ribbon.  In each scenario, I get the same results.
    Furthermore, I have also tested this in both IE8 and IE9 and get the same results.
    I can get it to occur most regularly with trying to apply the Paragraph "Markup Style" but
    I've also seen this happen with Font Size (any font size).  It's very frustrating since you aren't able to actually apply the formatting you need because the page jumps before you can click.  Has anyone experienced this before. Any feedback would
    help.

    Hi,
    According to your post, my understanding is that after applying full scroll bar to the page including header and footer, Text editor ribbon actions cause page to automatically scroll down (while applying formatting).
    I try to apply full scroll bar to the page including header and footer, the ribbon is missing after I scroll down to the web part. And I cannot apply the "Paragraph" markup style to the content.
    I recommend to use the SharePoint core styles to preserve the native functionality and GUI.
    By design in SharePoint, the ribbon is always at the top. When you select the content, you can apply the "Paragraph" markup style in the ribbon.
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Scrolling bars appearing without action

    I usually do not shut down my MBP equipped with ML for several days: I prefer to close the lid to have the computer ready to resume working. I noticed that after a few days of use applications start (together) to show scrolling bars like the Finder window below, even when system preferences are set to show them automatically (it's the default setting I never changed).
    Is there any other wrong setting or does it need to be fixed by Apple?

    This seems like a minor glitch, probably a snarky preference. No need to send it in for repair as you can easily work around it, while we try to solve it. Like working with  "Show scroll bars when scrolling". The difficulty is that it only happens after a few days of usage. Anything we do try, we'll have to wait a few days to see if it fixed it.
    Another usual step would be to test it in Safe Mode or another user account but here again it's not feasible because you can't work that way for days.
    Go to your Finder "Go" menu hold the option key and choose Library. Then go to Preferences folder and trash these files:
    com.apple.finder.plist
    com.apple.systempreferences.plist
    Then, restart, or log out and in again.
    (You will have to resetsome prefs the way you like them.)
    If it happens again open Console in your Utilities folder and copy & paste the information there at the time of the event.

  • Different Scroll bars in one file

    I've manually customized the look and feel of the scroll bars for scroll pane component and it works fine. I've two different files that have different visual styles for scroll bars. Now I want to merge these two files meaning I want to have one file with two different styles of scrollbars co-existing. I can resolve the naming conflicts but both of the them are using same asset names and action scripts (I think in the class definition).
    So basically my question if how can I have two different scroll bars implemented in one file?
    Many thanks

    You can make the clip that you want to play at 2 fps seem
    that way by just making it longer. Alternately, you could use a
    timed tween.

  • Web Form - takes extra time to render scroll-bar

    Hi,
    11.1.2.0.83
    When we open a webform that is relatively small in scale it takes ~ 4-6 seconds to come back from the 'hourglass' but then leaves the user waiting for upto a minute before the scrollbar appears at the side of the rendered web form (which appears after the initial period) and you can actually take any action.
    Smartview does not have this same delay on the same form, and when I monitor server / client activity on both sides it seems to be minimal impact on cpu / memory.
    We are on IE7, though some clients are IE8.
    Has anyone else seen this - is it a known issue - are there any fixes?
    thanks,
    Robert.

    Hi,
    I think both Planning and Essbase are done sending the required data/metadata to client and from that point on it's up to the client to generate the form. Like you are suggesting, although you see the form with cells and numbers, it takes time to generate the scroll bars (i.e. complete the form generation). My hunch is that this could be related to a security setting or an antivirus setting that could be slowing down the java script. Essentially, it's a hefty java script that generates the form and in some cases (such as with McAfee) there are certain settings to enable scanning java scripts on web pages before running them. You can make sure by tracking the process in task manager on the client when opening the form. If this is the case, disabling this option might improve the performance.
    Cheers,
    Alp

  • Remove/Hide scroll bars in scroll panes.

    Hi all,
    I am pretty new to action script. I am building a photo gallery and I am loading the thumbnails from an XML file into a scroll pane dynamically. As the scroll pane fills up, it gets wider to accomodate the thumbnails. There is one row, and eventually, I want to have the user be able to mouse left or right and have the scroll pane scroll, versus clicking on the bar or the left/right arrows. However, in order to accomplish this, I need the scroll bars to disappear!
    Is there anyway to either remove or hide both the x and y scroll bars on a scroll pane? My scroll pane is called: thumbPane.
    Thanks in advance!
    -Rob

    Hello friend,
                       first select scrollpane.Then open parameters panel (if dont know go to window > properties > paramiters ) turn to OFF HorizontalScrollPolicy  and verticalScrollPoliy then left and right scroll Bar will not display.
    THANKS.

  • JTextArea w/Scroll bar wont scroll AND code drops through if statements

    Hi, I'm still having trouble with the text area in the following code. When you run the code, you get the top arrow on the scroll bar, but the bottom is cut off. Also, a big problem is that no matter what choice is selected from the combo box, the code drops through to the last available value each time. Someone on the forums suggested using an array list for the values in the combo box, but I have not been able to figure out how to do that. A quick example would be apprciated.
    Thank you in advance for any help
    //Import required libraries
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import java.io.*;
    import java.text.*;
    import java.math.*;
    import java.util.*;
    //Create the class
    public class Week3Assignment407B extends JFrame implements ActionListener
         //Panels used in container
         private JPanel jPanelRateAndTermSelection;         
         //Variables for Menu items
         private JMenuBar menuBar;    
         private JMenuItem exitMenuItem; 
         private JMenu fileMenu; 
         //Variables for user instruction and Entry       
         private JLabel jLabelPrincipal;   
         private JPanel jPanelEnterPrincipal;  
         private JLabel jLabelChooseRateAndTerm; 
         private JTextField jTextFieldMortgageAmt;
         //Variables for combo box and buttons
         private JComboBox TermAndRate;
         private JButton buttonCompute;
         private JButton buttonNew; 
         private JButton buttonClose;
         //Variables display output
         private JPanel jPanelPaymentOutput;
         private JLabel jLabelPaymentOutput;
         private JPanel jPanelErrorOutput;
         private JLabel jLabelErrorOutput;  
         private JPanel jPanelAmoritizationSchedule;
         private JTextArea jTextAreaAmoritization;
         // Constructor 
         public Week3Assignment407B() {            
              super("Mortgage Application");      
               initComponents();      
         // create a method that will initialize the main frame for the GUI
          private void initComponents()
              setSize(700,400);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);      
              Container pane = getContentPane();
              GridLayout grid = new GridLayout(15, 1);
              pane.setLayout(grid);       
              //declare all of the panels that will go inside the main frame
              // Set up the menu Bar
              menuBar = new JMenuBar();
              fileMenu = new JMenu();
              fileMenu.setText("File");        
              exitMenuItem = new JMenuItem(); 
               exitMenuItem.setText("Exit");
              fileMenu.add(exitMenuItem); 
              menuBar.add(fileMenu);       
              pane.add(menuBar);
              //*******************TOP PANEL ENTER PRINCIPAL*****************************//
              // Create a label that will advise user to enter a principle amount
              jPanelEnterPrincipal = new JPanel(); 
              jLabelPrincipal = new JLabel("Amt to borrow in whole numbers");
              jTextFieldMortgageAmt = new JTextField(10);
              GridLayout Principal = new GridLayout(1,2);
              jPanelEnterPrincipal.setLayout(Principal); 
                jPanelEnterPrincipal.add(jLabelPrincipal);
              jPanelEnterPrincipal.add(jTextFieldMortgageAmt);
              pane.add(jPanelEnterPrincipal);
              //****************MIDDLE PANEL CHOOSE INTEREST RATE AND TERM*****************//
              // Create a label that will advise user to choose an Int rate and term combination
              // from the combo box
              jPanelRateAndTermSelection = new JPanel();
              jLabelChooseRateAndTerm = new JLabel("Choose the Rate and Term");
              buttonCompute = new JButton("Compute Mortgage");
              buttonNew = new JButton("New Mortgage");
              buttonClose = new JButton("Close");
              GridLayout RateAndTerm = new GridLayout(1,5);
              //FlowLayout RateAndTerm = new FlowLayout(FlowLayout.LEFT);
              jPanelRateAndTermSelection.setLayout(RateAndTerm);
              jPanelRateAndTermSelection.add(jLabelChooseRateAndTerm);
              TermAndRate = new JComboBox();
              jPanelRateAndTermSelection.add(TermAndRate);
              TermAndRate.addItem("7 years at 5.35%");
              TermAndRate.addItem("15 years at 5.5%");
              TermAndRate.addItem("30 years at 5.75%");
              jPanelRateAndTermSelection.add(buttonCompute);
              jPanelRateAndTermSelection.add(buttonNew);
              jPanelRateAndTermSelection.add(buttonClose);
              pane.add(jPanelRateAndTermSelection);
              //**************BOTTOM PANEL TEXT AREA FOR AMORITIZATION SCHEDULE***************//
              jPanelAmoritizationSchedule = new JPanel();
              jTextAreaAmoritization = new JTextArea(26,50);
              // add scroll pane to output text area
                   JScrollPane scrollBar = new JScrollPane(jTextAreaAmoritization, 
                   JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                     JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              jPanelAmoritizationSchedule.add(scrollBar);
                pane.add(jPanelAmoritizationSchedule);
              //***************ADD THE ACTION LISTENERS TO THE GUI COMPONENTS*****************//
              // Add ActionListener to the buttons and menu item
              exitMenuItem.addActionListener(this);
              buttonCompute.addActionListener(this);         
              buttonNew.addActionListener(this);
              buttonClose.addActionListener(this);
              TermAndRate.addActionListener(this);
              jTextFieldMortgageAmt.addActionListener(this);
              //*************** Set up the Error output area*****************//
              jPanelErrorOutput = new JPanel();
              jLabelErrorOutput = new JLabel();
              FlowLayout error = new FlowLayout();
              jPanelErrorOutput.setLayout(error);
              pane.add(jLabelErrorOutput);
              setContentPane(pane);
              pack();
              setVisible(true);
         //Display error messages
         private void OutputError(String ErrorMsg){
              jLabelErrorOutput.setText(ErrorMsg);
              jPanelErrorOutput.setVisible(true);
         //create a method that will clear all fields when the New Mortgage button is chosen
         private void clearFields()
              jTextAreaAmoritization.setText("");
              jTextFieldMortgageAmt.setText("");
         //**************CREATE THE CLASS THAT ACTUALLY DOES SOMETHING WITH THE EVENT*****//
         //This is the section that receives the action source and directs what to do with it
         public void actionPerformed(ActionEvent e)
              Object source = e.getSource();
              String ErrorMsg;
              double principal;
              double IntRate;
              int Term;
              double monthlypymt;
              double TermInYears = 0 ;
              if(source == buttonClose)
                   System.exit(0);
              if (source == exitMenuItem) {      
                       System.exit(0);
              if (source == buttonNew)
                   clearFields();
              if (source == buttonCompute)
                   //Make sure the user entered valid numbers
                   try
                        principal = Double.parseDouble(jTextFieldMortgageAmt.getText());
                   catch(NumberFormatException nfe)
                        ErrorMsg = (" You Entered an invalid Mortgage amount"
                                  + " Please try again. Please do not use commas or decimals");
                        jTextAreaAmoritization.setText(ErrorMsg);
                   principal = Double.parseDouble(jTextFieldMortgageAmt.getText());
                    if (TermAndRate.getSelectedItem() == "7 years at 5.35%") ;
                        Term = 7;
                        IntRate = 5.35;
                    if (TermAndRate.getSelectedItem()  == "15 years at 5.5%") ;
                        Term = 15;
                        IntRate = 5.5;
                    if (TermAndRate.getSelectedItem() == "30 years at 5.75%") ;
                        Term = 30;
                        IntRate = 5.75;
                   //Variables have been checked for valid input, now calculate the monthly payment
                   NumberFormat formatter = new DecimalFormat ("$###,###.00");
                   double intdecimal = intdecimal = IntRate/(12 * 100);
                   int months = Term * 12;
                   double monthlypayment = principal *(intdecimal / (1- Math.pow((1 + intdecimal),-months)));
                   //Display the Amoritization schedule
                   jTextAreaAmoritization.setText(" Loan amount of " + formatter.format(principal)
                                                    + "\n"
                                                    + " Interest Rate is " +  IntRate + "%"
                                            + "\n"
                                            + " Term in Years "  + Term
                                            + " Monthly payment "+  formatter.format(monthlypayment)
                                            + "\n"
                                            + "  Amoritization is as follows:  "
                                            + "------------------------------------------------------------------------");
         public Insets getInsets()
              Insets around = new Insets(35,20,20,35);
              return around;
         //Main program     
         public static void main(String[]args) { 
              Week3Assignment407B frame = new Week3Assignment407B(); 
       }

    here's your initComponents with a couple of changes, the problem was the Gridlayout(15,1)
    also, the scrollpane needed a setPreferredSize()
      private void initComponents()
        setSize(700,400);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Container pane = getContentPane();
        JPanel pane = new JPanel();
        //GridLayout grid = new GridLayout(15, 1);
        GridLayout grid = new GridLayout(2, 1);
        pane.setLayout(grid);
        menuBar = new JMenuBar();
        fileMenu = new JMenu();
        fileMenu.setText("File");
        exitMenuItem = new JMenuItem();
        exitMenuItem.setText("Exit");
        fileMenu.add(exitMenuItem);
        menuBar.add(fileMenu);
        //pane.add(menuBar);
        setJMenuBar(menuBar);
        jPanelEnterPrincipal = new JPanel();
        jLabelPrincipal = new JLabel("Amt to borrow in whole numbers");
        jTextFieldMortgageAmt = new JTextField(10);
        GridLayout Principal = new GridLayout(1,2);
        jPanelEnterPrincipal.setLayout(Principal);
          jPanelEnterPrincipal.add(jLabelPrincipal);
        jPanelEnterPrincipal.add(jTextFieldMortgageAmt);
        pane.add(jPanelEnterPrincipal);
        jPanelRateAndTermSelection = new JPanel();
        jLabelChooseRateAndTerm = new JLabel("Choose the Rate and Term");
        buttonCompute = new JButton("Compute Mortgage");
        buttonNew = new JButton("New Mortgage");
        buttonClose = new JButton("Close");
        GridLayout RateAndTerm = new GridLayout(1,5);
        jPanelRateAndTermSelection.setLayout(RateAndTerm);
        jPanelRateAndTermSelection.add(jLabelChooseRateAndTerm);
        TermAndRate = new JComboBox();
        jPanelRateAndTermSelection.add(TermAndRate);
        TermAndRate.addItem("7 years at 5.35%");
        TermAndRate.addItem("15 years at 5.5%");
        TermAndRate.addItem("30 years at 5.75%");
        jPanelRateAndTermSelection.add(buttonCompute);
        jPanelRateAndTermSelection.add(buttonNew);
        jPanelRateAndTermSelection.add(buttonClose);
        pane.add(jPanelRateAndTermSelection);
        jPanelAmoritizationSchedule = new JPanel();
        jTextAreaAmoritization = new JTextArea(26,50);
        JScrollPane scrollBar = new JScrollPane(jTextAreaAmoritization,
          JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        scrollBar.setPreferredSize(new Dimension(500,100));//<------------------------
        jPanelAmoritizationSchedule.add(scrollBar);
        getContentPane().add(pane,BorderLayout.NORTH);
        getContentPane().add(jPanelAmoritizationSchedule,BorderLayout.CENTER);
        exitMenuItem.addActionListener(this);
        buttonCompute.addActionListener(this);
        buttonNew.addActionListener(this);
        buttonClose.addActionListener(this);
        TermAndRate.addActionListener(this);
        jTextFieldMortgageAmt.addActionListener(this);
        jPanelErrorOutput = new JPanel();
        jLabelErrorOutput = new JLabel();
        FlowLayout error = new FlowLayout();
        jPanelErrorOutput.setLayout(error);
        //pane.add(jLabelErrorOutput);not worrying about this one
        //setContentPane(pane);
        pack();
        setVisible(true);
      }instead of
    if (TermAndRate.getSelectedItem() == "7 years at 5.35%") ;
    Term = 7;
    IntRate = 5.35;
    you would be better off setting up arrays
    int[] term = {7,15,30};
    double[] rate = {5.35,5.50,5.75};
    then using getSelectedIndex()
    int loan = TermAndRate.getSelectedIndex()
    Term = term[loan];
    IntRate = rate[loan];

  • Issue with Multithreading and vertical scroll bar - help needed to debug!!!

    I have been working on a desktop Visual Studio 2010 application for quite a few years. It is written in C++ and MFC. This code is a combination of code I have written and code I inherited. It worked great for years on Windows XP, but when I ported
    it to Windows 7, a tricky problem has come up that I am having the darnest time trying to figure out
    In summary, it is a single .exe desktop application. There is the main thread (thread A), which launches another thread (thread B). Both threads share a pointer to a single window object which displays events. This window also implements a vertical and horizontal
    scroll bar. 
    The interaction and message processing between the threads seems a little sticky to me. Both threads A and B call the same member function of the CWnd object. BUT, Thread B ALSO posts messages to thread A's queue.
    So, in thread B, you will see code like this, which makes a direct call to the output window object, AND THEN it also posts a message to Thread A's mainframe window like this...
    if( m_pEventLog )
    pOutputWindow->AddLine("Some test...");
    if( m_phNotifyWnd[RECEIVE] && m_puiEventWMsg[RECEIVE] ) {
    ::PostMessage( m_phNotifyWnd[RECEIVE], m_puiEventWMsg[RECEIVE], 0, (LPARAM) pPkt );
    WHEN thread A receives the message that thread B posted above, it only does the following:
    LRESULT CMainFrame::OnSocketReceive( WPARAM, LPARAM lParam )
    CSPkt* pPkt;
    CRWPkt* pRWPkt;
    CSPktSocket* pSocket;
    ULONG ulType;
    CString csTemp;
    CBSWords bsWords;
    CSSSWords sssWords;
    CRWPkt* pLoopBackRWMsg; // used if we have to send a loopback msg back to sender
    CLMsg lmsg;
    m_wndTextWindow.AddLine("Test message");
    return 0;
    So both threads are writing to the output window via the .AddLine() member function.
    void COutputWnd::AddLine( CString& strLine, COLORREF crColor )
    UpdateVScroll();
    return;
    And this function then makes a call to :UpdateVScroll().  The problem seems to arise because thread B does a
    post to thread A, where thread A in turn writes to the output window. Eventually, the program
    HANGS in the call to
    SetScrollInfo() below...
    void COutputWnd::UpdateVScroll()
    CSingleLock lock( &m_CSVertScrollLock ); // lock things up while we are in here
    BOOL bok = lock.Lock();
    if (lock.IsLocked() == TRUE)
    int iMax = m_FifoIndices.GetHighestIndex();
    if( iMax < ( m_iMaxViewableLines - 1 ) )
    iMax = 0;
    //SetScrollRange( SB_VERT, 0, iMax, FALSE );
    //SetScrollRange( SB_VERT, 0, 9, FALSE );
    SCROLLINFO scrollinfo;
    scrollinfo.cbSize = sizeof(SCROLLINFO);
    scrollinfo.fMask = SIF_RANGE;
    scrollinfo.nMin=0;
    scrollinfo.nMax= iMax;
    SetScrollInfo(SB_VERT, &scrollinfo, FALSE);
    lock.Unlock();
    It doesn't take long for the program to hang...maybe about 10 seconds. 
    When I hit DEBUG->BREAK ALL, I get the output below in the CALL STACK WINDOW.
    ntdll.dll!770070f4()
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
    user32.dll!76c0cde0()
    user32.dll!76c018d9()
    >
    mfc100d.dll!AfxInternalPumpMessage()  Line 153 + 0x13 bytes
    C++
    mfc100d.dll!CWinThread::PumpMessage()  Line 900
    C++
    mfc100d.dll!CWinThread::Run()  Line 629 + 0xd bytes
    C++
    mfc100d.dll!_AfxThreadEntry(void * pParam=0x0022f6a4)  Line 122 + 0x13 bytes
    C++
    msvcr100d.dll!_callthreadstartex()  Line 314 + 0xf bytes
    C
    msvcr100d.dll!_threadstartex(void * ptd=0x004f97c0)  Line 297
    C
    kernel32.dll!762cee1c()
    ntdll.dll!770237eb()
    ntdll.dll!770237be()
    NOTE: If I never make the call to SetScrollInfo(), the program never HANGS.
    Sooo....I am trying to determine if there is a fundamental issue with the way the threads are communicating that is causing the issue, or if maybe I have a memory overwrite. It always hangs in ::SetScrollInfo(), no matter what I comment and uncomment. This
    makes me think that scroll bat behavior is different in Windows 7 than on XP, but I have not been able to find any documentation about it. 
    Can anyone provide any insight as to what may be the cause of the program hanging>

    It might look like working but it will crash eventually. The windows are thread affine and other thread must never touch other threads windows. Sometimes you might get along but usually it just crashes.
    Thread B must use PostMessage ( or SendMessage if suncronous action is require) to thread A's windows to achieve correct updating. Some very basic calls are implemented directly with SendMessage so they are safe to use but then you must individually check
    which ones are safe.
    Also having multiple SendMessage calls from B to A require rendezvous which might cause other problems ( thread B stalls or program deadlocks, depending on other program structure).
    So PostMessage is the way to do it ( or create yourself another inter-thread mechanism, possible but usually too much troble)

  • Scroll bar problems ..Please help!!!!!!

    This is what the program looks like. topPanel has newItemPanel on top of it. when you click continue newItemPanel becomes invisible and newItemDescriptionPanel becomes visible. When you click continue newItemDescriptionPanel becomes invisible and priceEnterPanel becomes visible.
    I want newItemDescriptionPanel and priceEnterPanel to have a scroll bar. but everything I have tried hasn't worked. I am new. You will see the code is ugly and there is an attempt to add a scrollbar.
    Please help
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import java.lang.System;
    public class MainPanel extends      JFrame implements     ActionListener
         private boolean      firstRun = true;
         private final int     ITEM_PLAIN     =     0;     // Item types
         private final int     ITEM_CHECK     =     1;
         private final int     ITEM_RADIO     =     2;
         private     JPanel          topPanel;
         private JPanel          newItemPanel;
         private JRadioButton onlineAuctionRadio;
         private JRadioButton fixedPriceRadio;
         private ButtonGroup bg;
         private JButton     continueButton;
         private JLabel      blankLabel;       //used to give space between things
         private JPanel           newItemDescriptionPanel;
         private JPanel      takeAdditionalSpacePanelCheckBox;
         private JPanel      takeAdditionalSpacePanel;
         private JPanel          takeAdditionalSpacePanelLabel;
         private JPanel          takeAdditionalSpacePanelLabel2;
         private JPanel      takeAdditionalSpacePanel2;
         private JPanel      takeAdditionalSpacePanel3;
         private JPanel           takeAdditionalSpacePanel4;
         private JPanel           takeAdditionalSpacePanel5;
         JScrollPane displayScroller;
         JEditorPane itemDescriptionTextArea;
         GridBagLayout gridbag;
         GridBagConstraints gbc;
         private JCheckBox   secondCategoryCheckBox;
         private JLabel          itemTitleLabel;
         private JLabel          requiredLabel, requiredLabel2;
         private JLabel      requiredStarLabel;
         private JTextField  itemTitleTextField;
         private JLabel           subtitleLabel;
         private JTextField      subtitleTextField;
         private JLabel          itemDescriptionLabel;
         private JButton     itemDescriptionContinueButton;
         private JLabel          percentageLabel;
         //------- price enter page ----------------
         private JLabel          startingPriceLabel;
         private JLabel           dollarSignLabel;
         private JTextField     startingPriceTextField;
         private JPanel          fillUpSpacePanel;
         private JPanel          fillUpSpacePanel1;
         private JPanel          fillUpSpacePanel2;
         private JLabel          buyItNowLabel;
         private JPanel          fillUpSpacePanel3;
         private JLabel          dollarSignLabel2;
         private JTextField     buyItNowTextField;
         private JPanel          fillUpSpacePanel4;
         private JPanel          fillUpSpacePanel5;
         private JPanel          fillUpSpacePanel6;
         private JPanel          fillUpSpacePanel7;
         private JPanel          fillUpSpacePanel8;
         private JPanel          fillUpSpacePanel9;
         private JPanel          fillUpSpacePanel10;
         private JPanel          fillUpSpacePanel11;
         private JPanel          fillUpSpacePanel12;
         private JPanel          fillUpSpacePanel13;
         private JPanel          fillUpSpacePanel14;
         private JPanel          fillUpSpacePanel15;
         private JPanel          fillUpSpacePanel16;
         private JPanel          fillUpSpacePanel17;
         private JPanel          fillUpSpacePanel18;
         private JLabel          donatePercentageLabel;
         private JTextField     donatePercentageTextField;
         private JPanel          fSp; // fill space panel
         private JPanel          fSp1;
         private JPanel          fSp2;
         private JPanel          fSp3;
         private JPanel          fSp4;
         private JPanel          fSp5;
         private JPanel          fSp6;
         private JPanel          fSp7;
         private JPanel          fSp8;
         private JPanel          fSp9;
         private JLabel           numberOfPicturesLabel;
         private JTextField     numberOfPicturesTextField;
         private JCheckBox     superSizePicturesCheckBox;
         private JLabel          superSizePicturesLabel;
         private JRadioButton standardPictureRadioButton;
         private JRadioButton picturePackRadioButton;
         private JCheckBox     listingDesignerCheckBox;
         private ButtonGroup bgPictures;
         private JCheckBox      valuePackCheckBox;
         private JCheckBox     galleryPictureCheckBox;
         private JCheckBox     subtitleCheckBox;
         private JCheckBox     boldCheckBox;
         private JCheckBox     borderCheckBox;
         private JCheckBox     highlightCheckBox;
         private JCheckBox     featuredPlusCheckBox;
         private JCheckBox     galleryFeaturedCheckBox;
         private JLabel          homePageFeaturedLabel;
         private JComboBox     homePageFeaturedComboBox;
         private JCheckBox     giftCheckBox;
         JScrollPane priceEnterPanelScroll;
         private JButton          backToRadioButton;
         private JButton          backToItemDescriptionButton;
         private JPanel           priceEnterPanel;
         private final static String RADIOPANEL = "JPanel with radios";
         private final static String DESCRIPTIONPANEL = "JPanel with description";
         private final static String PRICEENTERPANEL = "JPanel with price entering";
         private JPanel           cards;
         private     JMenuBar     menuBar;
         private     JMenu          menuFile;
         private     JMenu          menuEdit;
         private     JMenu          menuProperty;
         private     JMenuItem     menuPropertySystem;
         private     JMenuItem     menuPropertyEditor;
         private     JMenuItem     menuPropertyDisplay;
         private     JMenu        menuFileNew;
         private JMenuItem   menuFileNewAccount;
         private JMenuItem   menuFileNewItem;
         private     JMenuItem     menuFileOpen;
         private     JMenuItem     menuFileSave;
         private     JMenuItem     menuFileSaveAs;
         private     JMenuItem     menuFileExit;
         private     JMenuItem     menuEditCopy;
         private     JMenuItem     menuEditCut;
         private     JMenuItem     menuEditPaste;
         public MainPanel()
              requiredLabel = new JLabel ("* Required");
              requiredLabel.setForeground (Color.red);
              requiredLabel2 = new JLabel ("* Required");
              requiredLabel2.setForeground (Color.red);
              requiredStarLabel = new JLabel ("*");
              requiredStarLabel.setForeground (Color.green);
              setTitle( "photo galleries" );
              setSize( 310, 130 );
              topPanel = new JPanel();
              topPanel.setLayout( new BorderLayout() );
              topPanel.setBorder (BorderFactory.createTitledBorder ("TopPanel"));
              //topPanel.setPreferredSize(new Dimension (300,300));
              getContentPane().add( topPanel );
              topPanel.setVisible (false);
              //     For New Item Panel
              ButtonListener ears = new ButtonListener();
              blankLabel = new JLabel ("  ");  // used to give space between radio buttons and continue button
              continueButton = new JButton ("Continue >");
              continueButton.addActionListener (ears);
              backToRadioButton = new JButton ("< back");
              backToRadioButton.addActionListener (ears);
              itemDescriptionContinueButton = new JButton ("Continue >");
              itemDescriptionContinueButton.addActionListener (ears);
              backToItemDescriptionButton = new JButton ("< back");
              backToItemDescriptionButton.addActionListener (ears);
              newItemPanel = new JPanel();
              newItemPanel.setLayout (new BoxLayout(newItemPanel, BoxLayout.Y_AXIS));
              //topPanel.add (newItemPanel, BorderLayout.NORTH);
              newItemPanel.setBorder (BorderFactory.createTitledBorder ("NewItemPanel"));
              newItemPanel.setVisible (false);
              onlineAuctionRadio = new JRadioButton ("Sold item at online Auction"     );
              fixedPriceRadio = new JRadioButton ("Sold at a Fixed Price");
              bg = new ButtonGroup();
              bg.add(onlineAuctionRadio);
              bg.add(fixedPriceRadio);
              onlineAuctionRadio.addActionListener (ears);
              fixedPriceRadio.addActionListener (ears);
              newItemPanel.add (onlineAuctionRadio);
              newItemPanel.add (fixedPriceRadio);
              newItemPanel.add (blankLabel);
              newItemPanel.add (continueButton);
              // ------ After continue pressed ---------
              newItemDescriptionPanel = new JPanel();
              newItemDescriptionPanel.setLayout (new BoxLayout(newItemDescriptionPanel, BoxLayout.Y_AXIS));
              newItemPanel.add (newItemDescriptionPanel, BorderLayout.NORTH);
              newItemDescriptionPanel.setBorder (BorderFactory.createTitledBorder ("newItemDescriptionPanel"));
              secondCategoryCheckBox = new JCheckBox ("The item was listed in a second category");
              newItemDescriptionPanel.setVisible (false);
              itemTitleLabel = new JLabel ("Item title");
              itemTitleTextField = new JTextField (30);
              subtitleLabel = new JLabel ("Subtitle ($0.50)");
              subtitleTextField = new JTextField (30);
              itemDescriptionLabel = new JLabel ("Item description");
              itemDescriptionTextArea = new JEditorPane();
              itemDescriptionTextArea.setContentType( "text/html" );
              itemDescriptionTextArea.setEditable( false );
              itemDescriptionTextArea.setPreferredSize(new Dimension (500,250));
              itemDescriptionTextArea.setFont(new Font( "Serif", Font.PLAIN, 12 ));
              itemDescriptionTextArea.setForeground( Color.black );
              gbc = new GridBagConstraints();
              gbc.gridx = 0;
              gbc.gridy = 4;
              displayScroller = new JScrollPane( itemDescriptionTextArea );
              gridbag = new GridBagLayout ();
              gridbag.setConstraints( displayScroller, gbc );
              itemDescriptionTextArea.setEditable( true );
              takeAdditionalSpacePanelCheckBox = new JPanel(new FlowLayout(FlowLayout.LEFT));
              takeAdditionalSpacePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
              takeAdditionalSpacePanelLabel = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
              takeAdditionalSpacePanelLabel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
              takeAdditionalSpacePanel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
              takeAdditionalSpacePanel3 = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
              takeAdditionalSpacePanel4 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              takeAdditionalSpacePanel5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              //takeAdditionalSpacePanel2.setBorder (BorderFactory.createTitledBorder ("Additonal 2"));
              takeAdditionalSpacePanelCheckBox.add (secondCategoryCheckBox);
              newItemDescriptionPanel.add (takeAdditionalSpacePanelCheckBox);
              //newItemDescriptionPanel.add (blankLabel);
              takeAdditionalSpacePanelLabel.add (itemTitleLabel);
              takeAdditionalSpacePanelLabel.add (requiredLabel);
              newItemDescriptionPanel.add (takeAdditionalSpacePanelLabel);
              //newItemDescriptionPanel.add (itemTitleTextField);
              takeAdditionalSpacePanel.add(itemTitleTextField);//<--add textfield to panel
              newItemDescriptionPanel.add (takeAdditionalSpacePanel);//<--add panel to boxlayout panel
              takeAdditionalSpacePanelLabel2.add (subtitleLabel);
              newItemDescriptionPanel.add (takeAdditionalSpacePanelLabel2);
              takeAdditionalSpacePanel2.add (subtitleTextField);
              newItemDescriptionPanel.add (takeAdditionalSpacePanel2);
              takeAdditionalSpacePanel4.add (itemDescriptionLabel);
              //takeAdditionalSpacePanel4.add (requiredLabel2);
              newItemDescriptionPanel.add (takeAdditionalSpacePanel4);
              takeAdditionalSpacePanel3.add (displayScroller);
              newItemDescriptionPanel.add (takeAdditionalSpacePanel3);
              takeAdditionalSpacePanel5.add (backToRadioButton);
              takeAdditionalSpacePanel5.add (itemDescriptionContinueButton);
              newItemDescriptionPanel.add (takeAdditionalSpacePanel5);
              //newItemDescriptionPanel.setLayout (new BoxLayout(newItemDescriptionPanel, BoxLayout.Y_AXIS));
              //----------- Price Enter Page ----------------
              priceEnterPanel = new JPanel();
              priceEnterPanel.setLayout (new BoxLayout(priceEnterPanel, BoxLayout.Y_AXIS));
              newItemDescriptionPanel.add (priceEnterPanel, BorderLayout.NORTH);
              priceEnterPanel.setBorder (BorderFactory.createTitledBorder ("Price enter Panel"));
              priceEnterPanel.setVisible (false);
              priceEnterPanelScroll = new JScrollPane (priceEnterPanel);
              topPanel.add (priceEnterPanelScroll);
              standardPictureRadioButton = new JRadioButton ("Standard");
              picturePackRadioButton = new JRadioButton ("Picture Pack ($1.00 for up to 6 pictures or $1.50 for 7 to 12 pictures)");
              bgPictures = new ButtonGroup();
              bgPictures.add(standardPictureRadioButton);
              bgPictures.add(picturePackRadioButton);
              standardPictureRadioButton.addActionListener (ears);
              picturePackRadioButton.addActionListener (ears);
              superSizePicturesCheckBox = new JCheckBox ("Supersize Pictures ($0.75)");
              listingDesignerCheckBox = new JCheckBox ("Listing designer $0.10");
              valuePackCheckBox = new JCheckBox ("Get the Essentials for less! Gallery, Subtitle, Listing Designer. $0.65 (save $0.30)");
              superSizePicturesCheckBox.setEnabled (false);
              superSizePicturesCheckBox.addActionListener (ears);
              listingDesignerCheckBox.addActionListener (ears);
              valuePackCheckBox.addActionListener (ears);
              startingPriceLabel = new JLabel ("Starting Price");
              dollarSignLabel = new JLabel ("$");
              startingPriceTextField = new JTextField (10);
              buyItNowLabel = new JLabel ("Buy It Now");
              dollarSignLabel2 = new JLabel ("$");
              buyItNowTextField = new JTextField (10);
              donatePercentageLabel = new JLabel ("Donate percentage of sale");
              donatePercentageTextField = new JTextField (2);
              donatePercentageTextField.setText ("0");
              percentageLabel = new JLabel ("%");
              // Right-justify the text
             donatePercentageTextField.setHorizontalAlignment(JTextField.RIGHT);
              numberOfPicturesLabel = new JLabel ("Number of pictures used");
              numberOfPicturesTextField = new JTextField (1);
              numberOfPicturesTextField.setText ("0");
              galleryPictureCheckBox = new JCheckBox ("Gallery ($0.35) [Requires a picture]");
              subtitleCheckBox = new JCheckBox ("Subtitle ($0.50)");
              boldCheckBox = new JCheckBox ("Bold ($1.00)");
              borderCheckBox = new JCheckBox ("Border ($3.00)");
              highlightCheckBox = new JCheckBox ("Highlight ($5.00)");
              featuredPlusCheckBox = new JCheckBox ("Featured Plus! ($19.95)");
              galleryFeaturedCheckBox = new JCheckBox ("Gallery Featured ($19.95) [Requires a picture]");
              homePageFeaturedLabel = new JLabel ("Home Page Featured ($39.95 for 1 item, $79.95 for 2 or more items)");
              homePageFeaturedComboBox = new JComboBox ();
              homePageFeaturedComboBox.addItem (("None..."));
              homePageFeaturedComboBox.addItem (("1 item"));
              homePageFeaturedComboBox.addItem (("2 or more items"));
              giftCheckBox = new JCheckBox ("Show as a gift ($0.25)");
              fillUpSpacePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel3 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel4 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel6 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel7 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel8 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel9 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel10 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel11 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel12 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel13 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel14 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel15 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel16 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel17 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel18 = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp1     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp2     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp3     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp4     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp5     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp6     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp7     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp8     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fSp9     = new JPanel(new FlowLayout(FlowLayout.LEFT));
              fillUpSpacePanel.add (startingPriceLabel);
              fillUpSpacePanel.add (requiredLabel2);
              priceEnterPanel.add (fillUpSpacePanel);
              fillUpSpacePanel2.add (dollarSignLabel);
              fillUpSpacePanel2.add (startingPriceTextField);
              priceEnterPanel.add (fillUpSpacePanel2);     
         //     fillUpSpacePanel1.add (backToItemDescriptionButton);
         //     priceEnterPanel.add (fillUpSpacePanel1);
              fillUpSpacePanel3.add (buyItNowLabel);
              priceEnterPanel.add (fillUpSpacePanel3);
              fillUpSpacePanel4.add (dollarSignLabel2);
              fillUpSpacePanel4.add (buyItNowTextField);
              priceEnterPanel.add (fillUpSpacePanel4);
              fillUpSpacePanel1.add (donatePercentageLabel);
              priceEnterPanel.add (fillUpSpacePanel1);
              fillUpSpacePanel5.add (donatePercentageTextField);
              fillUpSpacePanel5.add (percentageLabel);
              priceEnterPanel.add (fillUpSpacePanel5);
              fillUpSpacePanel6.add (numberOfPicturesLabel);
              priceEnterPanel.add (fillUpSpacePanel6);
              fillUpSpacePanel7.add (numberOfPicturesTextField);
              priceEnterPanel.add (fillUpSpacePanel7);
              fillUpSpacePanel8.add (standardPictureRadioButton);
              priceEnterPanel.add (fillUpSpacePanel8);
              fillUpSpacePanel10.add (blankLabel);
              fillUpSpacePanel10.add (superSizePicturesCheckBox);
              priceEnterPanel.add (fillUpSpacePanel10);
              fillUpSpacePanel9.add (picturePackRadioButton);
              priceEnterPanel.add (fillUpSpacePanel10);
              fillUpSpacePanel11.add (picturePackRadioButton);
              priceEnterPanel.add (fillUpSpacePanel11);
              fillUpSpacePanel12.add (listingDesignerCheckBox);
              priceEnterPanel.add (fillUpSpacePanel12);
              fillUpSpacePanel13.add (valuePackCheckBox);
              priceEnterPanel.add (fillUpSpacePanel13);
              fSp.add (galleryPictureCheckBox);
              priceEnterPanel.add (fSp);
              fSp1.add (subtitleCheckBox);
              priceEnterPanel.add (fSp1);
              fSp2.add (boldCheckBox);
              priceEnterPanel.add (fSp2);
              fSp3.add (borderCheckBox);
              priceEnterPanel.add (fSp3);
              fSp4.add (highlightCheckBox);
              priceEnterPanel.add (fSp4);
              fSp5.add (featuredPlusCheckBox);
              priceEnterPanel.add (fSp5);
              fSp6.add (galleryFeaturedCheckBox);
              priceEnterPanel.add (fSp6);
              fSp7.add (homePageFeaturedLabel);
              priceEnterPanel.add (fSp7);
              fSp8.add (homePageFeaturedComboBox);
              priceEnterPanel.add (fSp8);
              fSp9.add (giftCheckBox);
              priceEnterPanel.add (fSp9);
              newItemDescriptionPanel.add (priceEnterPanelScroll);
              //Create the panel that contains the "cards".
              cards = new JPanel(new CardLayout());
              cards.add(newItemPanel, RADIOPANEL);
              cards.add(newItemDescriptionPanel, DESCRIPTIONPANEL);
              cards.add(priceEnterPanel, PRICEENTERPANEL);
              topPanel.add(cards, BorderLayout.NORTH);
              // Create the menu bar
              menuBar = new JMenuBar();
              // Set this instance as the application's menu bar
              setJMenuBar( menuBar );
              // Build the property sub-menu
              menuProperty = new JMenu( "Properties" );
              menuProperty.setMnemonic( 'P' );
              // Create property items
              menuPropertySystem = CreateMenuItem( menuProperty, ITEM_PLAIN,
                                            "System...", null, 'S', null );
              menuPropertyEditor = CreateMenuItem( menuProperty, ITEM_PLAIN,
                                            "Editor...", null, 'E', null );
              menuPropertyDisplay = CreateMenuItem( menuProperty, ITEM_PLAIN,
                                            "Display...", null, 'D', null );
              //Build the File-New sub-menu
              menuFileNew = new JMenu ("New");
              menuFileNew.setMnemonic ('N');
              //Create File-New items
              menuFileNewItem = CreateMenuItem( menuFileNew, ITEM_PLAIN,
                                            "Item", null, 'A', null );
              menuFileNewAccount = CreateMenuItem( menuFileNew, ITEM_PLAIN,
                                            "Account", null, 'A', null );
              // Create the file menu
              menuFile = new JMenu( "File" );
              menuFile.setMnemonic( 'F' );
              menuBar.add( menuFile );
              //Add the File-New menu
              menuFile.add( menuFileNew );
              // Create the file menu
              // Build a file menu items
              menuFileOpen = CreateMenuItem( menuFile, ITEM_PLAIN, "Open...",
                                            new ImageIcon( "open.gif" ), 'O',
                                            "Open a new file" );
              menuFileSave = CreateMenuItem( menuFile, ITEM_PLAIN, "Save",
                                            new ImageIcon( "save.gif" ), 'S',
                                            " Save this file" );
              menuFileSaveAs = CreateMenuItem( menuFile, ITEM_PLAIN,
                                            "Save As...", null, 'A',
                                            "Save this data to a new file" );
              // Add the property menu     
              menuFile.addSeparator();
              menuFile.add( menuProperty );
              menuFile.addSeparator();
              menuFileExit = CreateMenuItem( menuFile, ITEM_PLAIN,
                                            "Exit", null, 'X',
                                            "Exit the program" );
              //menuFileExit.addActionListener(this);
              // Create the file menu
              menuEdit = new JMenu( "Edit" );
              menuEdit.setMnemonic( 'E' );
              menuBar.add( menuEdit );
              // Create edit menu options
              menuEditCut = CreateMenuItem( menuEdit, ITEM_PLAIN,
                                            "Cut", null, 'T',
                                            "Cut data to the clipboard" );
              menuEditCopy = CreateMenuItem( menuEdit, ITEM_PLAIN,
                                            "Copy", null, 'C',
                                            "Copy data to the clipboard" );
              menuEditPaste = CreateMenuItem( menuEdit, ITEM_PLAIN,
                                            "Paste", null, 'P',
                                            "Paste data from the clipboard" );
         public JMenuItem CreateMenuItem( JMenu menu, int iType, String sText,
                                            ImageIcon image, int acceleratorKey,
                                            String sToolTip )
              // Create the item
              JMenuItem menuItem;
              switch( iType )
                   case ITEM_RADIO:
                        menuItem = new JRadioButtonMenuItem();
                        break;
                   case ITEM_CHECK:
                        menuItem = new JCheckBoxMenuItem();
                        break;
                   default:
                        menuItem = new JMenuItem();
                        break;
              // Add the item test
              menuItem.setText( sText );
              // Add the optional icon
              if( image != null )
                   menuItem.setIcon( image );
              // Add the accelerator key
              if( acceleratorKey > 0 )
                   menuItem.setMnemonic( acceleratorKey );
              // Add the optional tool tip text
              if( sToolTip != null )
                   menuItem.setToolTipText( sToolTip );
              // Add an action handler to this menu item
              menuItem.addActionListener( this );
              menu.add( menuItem );
              return menuItem;
         public void actionPerformed( ActionEvent event )
              CardLayout cl = (CardLayout)(cards.getLayout());
              if (event.getSource() == menuFileExit)
                   System.exit(0);
              if (event.getSource() == menuFileNewAccount)
                   System.out.println ("hlkadflkajfalkdjfalksfj");
              if (event.getSource() == menuFileNewItem){
                   if (firstRun){
                        newItemPanel.setVisible (true);
                        topPanel.setVisible (true);
                   cl.show(cards,RADIOPANEL);
                   firstRun = false;
              //System.out.println( event );
         private class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent event)
                   CardLayout cl = (CardLayout)(cards.getLayout());
             //     cl.show(cards, (String)evt.getItem());
                   if (event.getSource() == continueButton){
                        if (!(onlineAuctionRadio.isSelected()) && !(fixedPriceRadio.isSelected()))
                             JOptionPane.showMessageDialog(null, "You must select at least one.", "Error", JOptionPane.ERROR_MESSAGE);
                        else{
                             if (onlineAuctionRadio.isSelected()){
                                  cl.show (cards, DESCRIPTIONPANEL);
                                  //newItemPanel.setVisible (false);
                                  //newItemDescriptionPanel.setVisible (true);
                   if (event.getSource() == itemDescriptionContinueButton){
                       if (itemTitleTextField.getText().trim().equalsIgnoreCase(""))
                            JOptionPane.showMessageDialog(null, "You must enter a title.", "Error", JOptionPane.ERROR_MESSAGE);
                        else
                             cl.show (cards, PRICEENTERPANEL);
                   if (event.getSource() == backToRadioButton){
                        cl.show (cards, RADIOPANEL);
                   if (event.getSource() == backToItemDescriptionButton){
                        cl.show(cards, DESCRIPTIONPANEL);
                   if (standardPictureRadioButton.isSelected()){
                        superSizePicturesCheckBox.setEnabled (true);
                   if (picturePackRadioButton.isSelected()){
                        superSizePicturesCheckBox.setEnabled (false);
              } //end of action performed
    }

    Mostly I see there is about 100 times as much code as I care to look at.
    So you don't know how to get a panel in a scroll pane, and then get that scroll pane into your GUI? Then try doing that by itself, not encumbered with 10000 lines of irrelevant code. Once you have it working, plug it into the big lump of code. Or if you can't get it working, ask about the small problem here.

  • Newbie needs scroll bar help

    Hello anyone,
    I am fairly new to flash, I am using the MX version. I am
    having trouble getting my scroll bars to load with the page load?
    The bar shows up, but it does not give the option to scroll. If I
    click off the page and return to it then the slider is there and it
    works, but not on initial load. I have tried to set the action
    script run on load but this has not worked. I am a little confused
    and any help would be greatly appriciated.
    Also as an aside issue, can you load images into a text
    box?

    am I on the right board for this type of question? I am not
    very knowledgable in action scripts, but I have been trough the
    tutorials and I bought the action scripts for dummies book, however
    I have done everything that they say to do and still can't get the
    bars to work right.
    any help or redirection for help somewhere else would be
    greatly appriciated.

  • How can I get the vertical scroll bar in firefox for mac to operate more smoothly?

    This scroll bar issue has been a real pain for awhile, though it seemed to be better for a period of time and now has grown much worse again. I'm using Firefox 22.0. I try to grasp the blue scroll bar (right side placement) to move it up or down for pages that require scrolling to view, and it is very hard to hold and move the bar, plus it often bogs down as the colored wheel shows up as if the software is trying to process the action. It's very frustrating. I'm set to "smooth scrolling" in the Firefox settings, but that doesn't help. Is there a way to fix this and make the scroll bar move quickly and smoothly in Firefox for Mac?

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

Maybe you are looking for

  • Creative cloud trial install, about to NOT buy it!!!!!!

    I am literally MOMENTS from snapping here. Adobe is increasingly ticking me RIGHT OFF! I can not even share with you how angry I am right now. This is ridiculous. First I am NOT pleased with their latest "subscription based" programs idea. It is a ri

  • How to include TOC in the PDF version of iBook

    I want to save my ibook to pdf and have the TOC included. There is an option in the print command that asks if I want save as pdf and include the whole book, the front cover and glossary but not the TOC - anyone can help me?

  • Selecting from XMLTYPE table

    HI Gentlemen, Given a schema-based XMLTYPE table with one big XML instance stored in it. I would like to select a subtree like <gnr V="12345" ...> ... </gnr> where the attribute could be a bind parameter dynamically changing. As an output I would lik

  • Name on email -- form submissions

    I have a form already to send out to my employees for choosing what event they want to participate in.  Everything works fine, except is there a way that when I receive the email notification back that the employee names appears on email.  I know it

  • ObjectOutputStream problem

    hi, All, I try to send the Vector to the applet from Servlet, but when I insert the code: the ObjectOutputStream objin = new ObjectOutputStream(res.getOutputStream()); there are many error comes out, can any one tell me what's wrong with this line of