Scrollbar postion in the middle of scrolling context

I'm working on a project where i give the user the ability to zoom an image,
the problem is when the user zoom the image, the right and left scrollbars are positioned at the beggining of the FigureCanevas.
What i want is when redrawing the image, the scrollbars should be in the middle of their scrolling context, what will give him a look on the center of the image after redrawing.
Any idea.
regards.
Edited by: Otmane on May 23, 2012 3:57 PM

Try:
- Reset the iOS device. Nothing will be lost      
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Restore from backup. See:                                               
iOS: Back up and restore your iOS device with iCloud or iTunes
- Restore to factory settings/new iOS device.                       
If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
  Apple Retail Store - Genius Bar                                              

Similar Messages

  • How to get only the middle panel to resize and show a scrollbar ?

    I have a window(frame) that has three panels - top, middle and bottom. When the window is shrunk vertically, I need a scrollbar to show up for the middle panel only. So the maximum vertical shrink possible would be the sum of the top and bottom panels plus some small amount (to see the middle panel scroll bar). So the top and bottom panels would always show completely (height wise). Please review my code and suggest corrections. I've tried couple of different ways but without success....The code below is my most recent attempt.
    Thanks.....
    import java.awt.*;
    import java.awt.Color.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import javax.swing.*;
    import javax.swing.plaf.ComponentUI;
    public class PanelResizingA extends JPanel implements MouseListener, MouseMotionListener
          * @param args
         public static void main(String[] args)
              JFrame frame = new JFrame ("All Panels");
              PanelResizingA allThreePanels = new PanelResizingA();
              JScrollPane allHorizontalScroll = new JScrollPane();
              //frame.add(allHorizontalScroll);
              allHorizontalScroll.setViewportView(allThreePanels);
              allHorizontalScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              allHorizontalScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
              frame.getContentPane().add(allHorizontalScroll);
              frame.setVisible(true);
              frame.pack();
         private JPanel topPanel;
         private JPanel midPanel;
         private JPanel bottomPanel;
         private JPanel allPanels;
         private JScrollPane midVerticalScroll;
         private JScrollPane allHorizontalScroll;
         private JLabel posnCheckLabel;
         private int panelWidth = 0;
         private int topPanelHt = 0;
         private int midPanelHt = 0;
         private int bottomPanelHt = 0;
         private int allPanelsHt = 0;
         private Point pointPressed;
         private Point pointReleased;
         public PanelResizingA()
              createAllPanels();
         private void createAllPanels()
              topPanel = new JPanel();
              midPanel = new JPanel();
              bottomPanel = new JPanel();
              allPanels = new JPanel();
              posnCheckLabel = new JLabel("Label in Center");
              panelWidth = 300;
              topPanelHt = 150;
              midPanelHt = 200;
              bottomPanelHt = 150;
              allPanelsHt = topPanelHt + midPanelHt + bottomPanelHt;
              //topPanel.setMinimumSize(new Dimension(panelWidth-150, topPanelHt));
              //topPanel.setMaximumSize(new Dimension(panelWidth, topPanelHt));
              topPanel.setPreferredSize(new Dimension(panelWidth, topPanelHt));
              topPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
              midPanel.setMinimumSize(new Dimension(panelWidth-150, midPanelHt-150));
              midPanel.setMaximumSize(new Dimension(panelWidth, midPanelHt));
              midPanel.setPreferredSize(new Dimension(panelWidth, midPanelHt-3));
              midPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
              midPanel.setLayout(new BorderLayout());
              midPanel.add(posnCheckLabel, BorderLayout.CENTER);
              //midPanel.add(new PanelVerticalDragger(midPanel), BorderLayout.SOUTH);
              //bottomPanel.setMinimumSize(new Dimension(panelWidth-150, bottomPanelHt));
              //bottomPanel.setMaximumSize(new Dimension(panelWidth, bottomPanelHt));
              bottomPanel.setPreferredSize(new Dimension(panelWidth, bottomPanelHt));
              bottomPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
              allPanels.setMinimumSize(new Dimension (panelWidth-150, allPanelsHt-300));
              allPanels.setMaximumSize(new Dimension(panelWidth+25, allPanelsHt+25));
              allPanels.setPreferredSize(new Dimension(panelWidth, allPanelsHt));
              midVerticalScroll = new JScrollPane();
              //midPanel.add(midVerticalScroll);
              midVerticalScroll.setViewportView(midPanel);
              midVerticalScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              midVerticalScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
              allPanels.setLayout(new BoxLayout(allPanels,BoxLayout.Y_AXIS));
              allPanels.add(topPanel);
              allPanels.add(midPanel);
              allPanels.add(bottomPanel);
              this.add(allPanels);
              addMouseListener(this);
              addMouseMotionListener(this);
         private void updateCursor(boolean on)
              if (on)
                   setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
              else
                   setCursor(null);
         @Override
         public void mousePressed(MouseEvent e)
              pointPressed = e.getLocationOnScreen();
              updateCursor(true);
         @Override
         public void mouseDragged(MouseEvent e)
              mouseReleased(e);
              pointPressed = e.getLocationOnScreen();
         @Override
         public void mouseReleased(MouseEvent e)
              pointReleased = e.getLocationOnScreen();
              Dimension allPanelsPrefSize = this.allPanels.getPreferredSize();
              Dimension midPanelPrefSize = this.midPanel.getPreferredSize();
              Dimension allPanelsSize = this.allPanels.getSize();
              Dimension allPanelsMinSize = this.allPanels.getMinimumSize();
              int midPanelPrefHt = midPanelPrefSize.height;
              int midPanelPrefWidth = midPanelPrefSize.width;
              int maxHtDelta = allPanelsPrefSize.height - allPanelsMinSize.height;
              //int deltaY = pointPressed.y - pointReleased.y;
              Point panelLocation = this.getLocation();
              Dimension size = this.getSize();
              if (size.height < allPanelsSize.height)
                   int deltaY = pointPressed.y - pointReleased.y;
                   if (deltaY < maxHtDelta)
                        midPanelPrefHt = midPanelPrefHt-deltaY;
                   else {midPanelPrefHt = this.midPanel.getMinimumSize().height;}
                   this.midPanel.setPreferredSize(new Dimension(midPanelPrefWidth, midPanelPrefHt));
                   this.midVerticalScroll.setViewportView(this.midPanel);
                   allPanels.setLayout(new BoxLayout(allPanels,BoxLayout.Y_AXIS));
                   allPanels.add(topPanel);
                   allPanels.add(midVerticalScroll);
                   allPanels.add(bottomPanel);               
              midVerticalScroll.revalidate();
              pointPressed = null;
              pointReleased = null;
         @Override
         public void mouseEntered(MouseEvent e)
              updateCursor(true);
         @Override
         public void mouseExited(MouseEvent e)
         @Override
         public void mouseClicked(MouseEvent e)
         @Override
         public void mouseMoved(MouseEvent e)
    }Edited by: 799076 on Oct 8, 2010 12:53 PM
    Edited by: 799076 on Oct 8, 2010 12:55 PM

    Rob,
    1. Sample code
    ScrollablePanel panel = new JScrollablePanel(...);
    panel.setScrollableWidth( ScrollablePanel.ScrollableSizeHint.FIT );references a JScrollablePanel - i'm assuming this is a typo and should read new ScrollablePanel()?
    Anyway I've tried this but it still does not show a vertical scroll bar for the middle panel:
    package JavaTutes;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Color;
    import javax.swing.*;
    import javax.swing.Scrollable;
    public class PanelResizingB extends JPanel
       private static final Dimension PANEL_SIZE = new Dimension(500, 250);
       private String[] labelStrings = {"Top Panel", "Middle Panel", "Bottom Panel"};
       private JScrollPane midVertScroll;
       private JScrollPane allHorzScroll;
       public PanelResizingB()
          setLayout(new BorderLayout());
          //JPanel allPanels = new JPanel();
          ScrollablePanel midPanel = new ScrollablePanel();
          midPanel.setScrollableHeight(ScrollablePanel.ScrollableSizeHint.FIT);
          //midPanel.setScrollableWidth(ScrollablePanel.ScrollableSizeHint.FIT);
          midPanel.add(new JLabel("Middle Panel"));
          midPanel.setPreferredSize(PANEL_SIZE);
          midPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
          JPanel[] panels = new JPanel[labelStrings.length];
          for (int i = 0; i < panels.length; i++)
             panels[i] = new JPanel(new BorderLayout());
             panels.add(new JLabel(labelStrings[i]));
    panels[i].setPreferredSize(PANEL_SIZE);
    panels[i].setBorder(BorderFactory.createLineBorder(Color.BLACK));
    setLayout(new BorderLayout());
    add(panels[0], BorderLayout.NORTH);
    add(new JScrollPane(midPanel), BorderLayout.CENTER);
    add(panels[2], BorderLayout.SOUTH);
    add(new JScrollPane(allPanels));
    private static void createAndShowUI()
    JFrame frame = new JFrame("PanelResizingB");
    PanelResizingB allThreePanels = new PanelResizingB();
    JScrollPane allHorizontalScroll = new JScrollPane();
    allHorizontalScroll.setViewportView(allThreePanels);
    //allHorizontalScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    //allHorizontalScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    frame.getContentPane().add(allHorizontalScroll);
    //frame.getContentPane().add(new PanelResizingB());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args)
    java.awt.EventQueue.invokeLater(new Runnable()
    public void run()
    createAndShowUI();
    I'm sure it is something simple - but I'm just not getting it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Scrollbars in the middle of panel

    My panel scrollbars are in the middle of the panel (see attached screenshot). I don't know how I did it. Worse though, I don't know how to get them back to the edges of the panel.
    Any help is appreciated. BTW, I'm using LV 8.6. If I create a new VI, everything is normal so I could just copy everything over ...
    Thanks,
    H
    Attachments:
    VI_Scrollbar_Problem.JPG ‏69 KB

    Edit the Background in the sense...
    Shift + Right Click will give that pallet
    Like this... It may be become invisible....
    For more questions pleae post your code...
    <<Kudos are welcome>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

  • I can no longer scroll anywhere on the page by clicking on the red mouse pointer and the middle mouse tab on the laptop

    Prior to upgrading to version 4 of Firefox, I was able to scroll anywhere on a page by holding the red mouse button and the middle mouse tab on my laptop. Now, in order to scroll on a page, I need to click on the sliding bar at the right of the page whereas, I was able to do both before the upgrade.

    Since today the scrolling started to work for me. Was there a fix auto installed? I havent updated anything that I know about.
    I might have uninstall an old Java JRE, don't remember when I did it, could that have done it?

  • How do i get rid of a scroll bar in the middle of everything?

    I have what "it" calls a black Scroll Bar in the middle of the screen.  How do I get rid of it?

    Can you take a screen shot and post t?
    Also, it is very hard for people to help when we don't know which of the many iMac variatnts you have was what version of the Mac operating system you are running. Also let us know if this is limited to a specific program or happens no matter what you are doing with the computer.
    A good place to start is with "About this Mac" from your Apple menu:

  • Start a horizontal scroll in the middle of a table?

    Hello,
    My demanding users are at it again. Although I am learning alot but lest I digress;-) Lets say I have a tableview with 72 columns that is one month for each year spanning over 6 years. No biggie but instead of the horizontal scroll starting at the left most point I would like start the scroll in the middle (say at column 36 or something) of the tableview. So if my tableview starts at 03/2002 in column 1 and goes to 03/2008 in column 72 I want the horizontal scroll to start at 03/2005(current month)in column 36 each time the table is rendered. I am using MVC and the tableview iterator(which I love).
    I was hopeing that I could find something similar to a dropdown i.e. pre-populate a selected value and the dropdown starts at that selection not the top most one. Any one have any ideas where I could begin? I have searched this forum for 'horizontal' and 'scrolling' but no hits.
    TIA,
    Rich

    Hello!
    I gave the example from Thomas Ritter to the JS person here and he got it working. I can't take credit but I wanted to share it with the forum. Basically what happens is that the horizontal scroll will scroll to the right till the date column that is close to the current date. I say close to because some of the columns are in months so if the current date is 21-MAR-05 then the horizontal scroll will scroll right until MAR-05. Either way here is the code. As I said before I take no credit for it. I do have another question though. Anyone have any ideas how to change it so that I can pass it a date and have it scroll there instead of the current date?
    <code>function lockCol(tblID) {
         var table = document.getElementById(tblID);     
         var cTR = table.getElementsByTagName('tr');  //collection of rows
         var coords = { x: 0, y: 0 };
         var now = new Date();
         var strMonthArray = new Array(12);
         strMonthArray[0] = "Jan";
         strMonthArray[1] = "Feb";
         strMonthArray[2] = "Mar";
         strMonthArray[3] = "Apr";
         strMonthArray[4] = "May";
         strMonthArray[5] = "Jun";
         strMonthArray[6] = "Jul";
         strMonthArray[7] = "Aug";
         strMonthArray[8] = "Sep";
         strMonthArray[9] = "Oct";
         strMonthArray[10] = "Nov";
         strMonthArray[11] = "Dec";
         strMonth = strMonthArray[now.getMonth()];
         year = new String(now.getYear());
         var today = now.getDate() + "-" + strMonth + "-" + year.substr(2,2);
         if (table.rows[0].cells[0].className == '') {
              for (i = 1; i < cTR.length; i++) {
                   var tr = cTR.item(i);
                   if(i == 1){
                        tr.cells[0].className = 'firstLocked';
                        innerloop:
                        for (j = 2; j < 100 ; j++) {
                             if(compareDate(today, tr.cells[j].innerText)) {                         
                                  elt = tr.cells[j];
                                  while (elt) {
                                       coords.x += elt.offsetLeft;
                                       elt = elt.offsetParent;
                             break innerloop;
                   else{tr.cells[0].className = 'locked'}
         else {
              for (i = 1; i < cTR.length; i++){
              var tr = cTR.item(i);
              tr.cells[0].className = '';
         document.getElementById('tbl-container').scrollLeft = coords.x - 69;
    function compareDate(date1, date2){
         a = date1.split("-");
         b = date2.split("-");
         day1 = parseInt(a[0]);
         month1 = a[1];
         year1 = a[2];
         day2 = parseInt(b[0]);
         month2 = b[1];
         year2 = b[2];
         if(year1 == year2) {
              if(month1 == month2) {
                   if((day2 >= day1)) {return true;}
                   else {return false;}
              else {return false;}     
         else {return false;}
    }</code>
    Cheers,
    Rich

  • Horizontal scroll thumb to start in the middle?

    Hi,
    To centre the thumb on a horizontal scoll bar, to get it to start in the middle, I would have thought you set the following:
    - Max = 100
    - Min = 0
    - Value = 50
    But for some reason my scroll bars are starting from the far left. And any changes I make seem to make no difference.
    Anyone else have this trouble?
    I've tried the following as well:
    - Max = 1150 (no. of pixels width of my image that I am scolling)
    - Min = 0
    - Value = 550
    Although the thumb moves to the middle of the track in the artboard, within FC, but when I run the project or export it ... the thumb is at the 0 value (the far left)
    Am I doing something wrong?
    Thanks,
    Nick

    You can extend a ViewHandler where you can check if the user is requesting an allowed page:
    public class MyViewHandler extends ViewHandler {
    private final ViewHandler base;
    public WebTikViewHandler(ViewHandler base) {
    this.base = base;
    public UIViewRoot createView(FacesContext facesContext, String viewId) {
    if (!viewId.contains("/app/index.jspx" && isNewSession() ){
    newViewId = "/app/index.jspx";
    return base.createView(facesContext, newViewId);
    You can implement the isNewSession method with a session variable.
    hth,
    Andrej

  • The horizontal scroll bar appears in the middle on Safari.

    Hello.
    I have a problem of Ipad mini
    A few user has the same prolem like me T.T when I checked other users is using Ipad mini or related Ipad series on web.
    and I could not find solution for it,
    The probelm is : the horizontal scroll bar position is changed as below image, the scroll bar appears in the middle on web page of Safari
    after zoom the page out and moving.
    How to fix this problem ?
    I already did it with a few way to fix and it never fix in my side.
    - Resotre factory mode : still happened.
    - Turn off and on Ipad mini : still happened.
    - Clear Cooke and data in safari setup.
       If Clear cooke and data, it just disappeared on web surfing but this is only temporary way, I could meet the problem soon on web surfing.
    Please help me to fix and share some information for it.
    Thanks.

    I am having the same issue. Went to the Apple Store in Boston and the Genius Bar escalated the problem to the Engineers and they could not even solve it. They needed me to send them an image of the issue. I went to another Apple store and the Genius there had much better problem solving skills. He used his own critical thinking and discovered that the horizontal scroll bar sits at the same height. The height is exactly where the split keyboard ends. If you take screen shots and compare...you will find they are all at the same height. He thinks since the keyboard is a new feature they havent worked out the problems yet...and we will have to wait for the update.
    Ever since Steve Jobs has been gone the call to response for issues is getting increasing slower and slower. New products continue to roll out but they all have problems and bugs. Take Maps for instance...they still have not fixed all the issues (even with this 6.0.1 update). The Ipad mini I spend 700$ for and it is such a faulty product. For what I spent I would have thought I would have gotten a great product. I have all Apple products...phone, desktop, laptop, Ipad original, and Mini...but they have done me wrong over and over. It may take months for them to roll out the fix the way the compnay has been operating under Cook.
    When will the fix come....I do not know... best of luck!

  • TableView scrolling even when scroll bar is in the middle

    All
    If we have a table that has events being inserted into it constantly when I move the scrollbar half way down the table keeps scrolling so I can't fix
    it on a certain row that I want to look at.

    I am having the same issue. Went to the Apple Store in Boston and the Genius Bar escalated the problem to the Engineers and they could not even solve it. They needed me to send them an image of the issue. I went to another Apple store and the Genius there had much better problem solving skills. He used his own critical thinking and discovered that the horizontal scroll bar sits at the same height. The height is exactly where the split keyboard ends. If you take screen shots and compare...you will find they are all at the same height. He thinks since the keyboard is a new feature they havent worked out the problems yet...and we will have to wait for the update.
    Ever since Steve Jobs has been gone the call to response for issues is getting increasing slower and slower. New products continue to roll out but they all have problems and bugs. Take Maps for instance...they still have not fixed all the issues (even with this 6.0.1 update). The Ipad mini I spend 700$ for and it is such a faulty product. For what I spent I would have thought I would have gotten a great product. I have all Apple products...phone, desktop, laptop, Ipad original, and Mini...but they have done me wrong over and over. It may take months for them to roll out the fix the way the compnay has been operating under Cook.
    When will the fix come....I do not know... best of luck!

  • Setting the scrollbar to be by default in the middle of the scrollpane

    I was wondering if there was a way to set the JScrollBar to be at the middle of the scrollpane by default. I have a handle to the scrollbar and can determine the min and max of it's range, but I don't see a place to set the scrollbar position.

    This is a runnable stand-alone app.
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Component;
    import java.awt.Color;
    import java.awt.Font;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.util.*;
    public class MarketBook extends JFrame implements WindowListener,
                                                      ActionListener{
         protected final int ROW_HEIGHT = 15;
         protected final int NUM_ROW = 14;
         protected final int PREF_WIDTH = 200;
         protected final int PREF_HEIGHT = 150;
         protected final int BID_COL = 1;
         protected final int OFFER_COL = 2;
         private String instrument;
         private String mkbkID;
         private String[] instArray = {"Item1", "Item2", "Item3"};
         private String[] colNames = {"Qty", "Bid", "Offer", "Qty"};
         private Vector<String> instrumentsList = new Vector<String>();
         private DefaultTableModel dm = new DefaultTableModel(colNames, NUM_ROW);
         private DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
         JPanel contentPane = new JPanel();
         JPanel topPanel = new JPanel();
         JComboBox instList = new JComboBox(instArray);
         JTable bidOffer = new JTable(){
              public boolean isCellEditable(int row, int column){
                        return false;
         JScrollPane bidOfferScroll = new JScrollPane(bidOffer);
         public MarketBook(String _mkbkID, Vector<String> _instList){
              super(_instList.firstElement());
              this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
              this.mkbkID = _mkbkID;
              this.instrumentsList = _instList;
              this.instrument = instrumentsList.firstElement();
              buildGUI();
         private void buildGUI(){
              TableColumn tc = null;
              contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
              bidOfferScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
              bidOfferScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              bidOfferScroll.setPreferredSize(new Dimension(PREF_WIDTH,PREF_HEIGHT));
              System.err.println("Max: " + bidOfferScroll.getVerticalScrollBar().getMaximum());
              System.err.println("Min: " + bidOfferScroll.getVerticalScrollBar().getMinimum());
              System.err.println("Extent: " + bidOfferScroll.getVerticalScrollBar().getVisibleAmount());
              System.err.println("Value: " + bidOfferScroll.getVerticalScrollBar().getValue());
              bidOfferScroll.getVerticalScrollBar().setValueIsAdjusting(true);
              bidOfferScroll.getVerticalScrollBar().setValue(50);
              System.err.println("Value: " + bidOfferScroll.getVerticalScrollBar().getValue());
              System.err.println("Model: " + bidOfferScroll.getVerticalScrollBar().getModel());          
                        bidOfferScroll.getVerticalScrollBar().getMaximum()-
                        bidOfferScroll.getVerticalScrollBar().getMinimum())/2);*/
              topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
              topPanel.add(instList);
              instList.addActionListener(this);
              bidOffer.getTableHeader().setFont(new Font(null, Font.BOLD, 12));
              bidOffer.setAlignmentX(JTable.CENTER_ALIGNMENT);
              bidOffer.setModel(dm);
              bidOffer.getColumnModel().getColumn(0).setPreferredWidth(40);
              bidOffer.getColumnModel().getColumn(1).setPreferredWidth(60);
              bidOffer.getColumnModel().getColumn(2).setPreferredWidth(60);
              bidOffer.getColumnModel().getColumn(3).setPreferredWidth(40);               
              bidOffer.setRowHeight(ROW_HEIGHT);
              // Set table renderer
              for(int i = 0; i < bidOffer.getColumnCount(); i++){
                   tc = bidOffer.getColumnModel().getColumn(i);
                   tc.setCellRenderer(new CustomTableCellRenderer());
              contentPane.add(topPanel);
              contentPane.add(bidOfferScroll);
              JFrame.setDefaultLookAndFeelDecorated(true);
              this.setContentPane(contentPane);
              this.pack();
              this.setVisible(true);
         public void actionPerformed (ActionEvent e){
              JComboBox cb = (JComboBox)e.getSource();
              String selectedItem = (String)cb.getSelectedItem();
              updateSelectedInst(selectedItem);
         public void windowActivated(WindowEvent arg0) {
              // TODO Auto-generated method stub
         public void windowClosed(WindowEvent arg0) {
              // TODO Auto-generated method stub
         public void windowClosing(WindowEvent arg0) {
              // TODO Auto-generated method stub
              this.setVisible(false);
              this.dispose();
              System.exit(0);
         public void windowDeactivated(WindowEvent e) {
              // TODO Auto-generated method stub
         public void windowDeiconified(WindowEvent e) {
              // TODO Auto-generated method stub
         public void windowIconified(WindowEvent e) {
              // TODO Auto-generated method stub
         public void windowOpened(WindowEvent e) {
              // TODO Auto-generated method stub
         // Perform all updates necessary when new instrument is selected
         private void updateSelectedInst(String inst){
              this.setTitle(inst);
         class CustomTableCellRenderer extends DefaultTableCellRenderer{
              public Component getTableCellRendererComponent(JTable table,
                        Object value, boolean isSelected, boolean hasFocus,
                        int row, int column){
                   Component cell = super.getTableCellRendererComponent(table,
                                       value, isSelected, hasFocus, row, column);
                   if (column == BID_COL){
                        cell.setBackground(Color.red);
                   else if (column == OFFER_COL){
                        cell.setBackground(Color.blue);
                   //cell.setFont(f)
                   return cell;
         public static void main(String args[]){
              Vector<String> tempVector = new Vector<String>();
              tempVector.add("item1");
              tempVector.add("item2");
              MarketBook marketBook1 = new MarketBook("mkbk1", tempVector);
    }

  • Whenever I play anything on Windows Media Player Classic, the middle mouse button does not work as a vertical scroll in firefox, but instead shows a horizontal scroll that does not scroll the web pages. How can I fix this problem?

    Hi
    I have a windows 7 and whenever I play anything on Windows Media Player Classic, the middle mouse button does not work as a vertical scroll in firefox, but instead shows a horizontal scroll that does not scroll the web pages. How can I fix this problem?
    I hope that was clear.
    Thnx

    Hello kmanthie,
    I just sent you a private message. If you are not sure how to check your forum messages, this post has instructions.
    I worked on behalf of HP.

  • What do you call it when there is a scroll bar in the middle of your page?

    Hi,
    I have a few pages that have four paragrapghs of text. I
    don't want the over all dimensions of my page to change so I want
    to have a window within my page that will have a scroll bar
    allowing the visitor to scroll throught the text without having to
    scroll down the whole page.
    Can I do this through css?
    Know what I mean?
    Thanks,

    You can use a scrolling div - a simple how to here:
    http://tinyurl.com/l3upf
    Nadia
    Adobe� Community Expert : Dreamweaver
    http://www.csstemplates.com.au
    - CSS Templates | Free Templates
    http://www.perrelink.com.au
    - Web Dev
    http://www.DreamweaverResources.com
    - Dropdown Menu Templates|Tutorials
    http://www.adobe.com/devnet/dreamweaver/css.html
    > Hi,
    > I have a few pages that have four paragrapghs of text. I
    don't want the
    > over
    > all dimensions of my page to change so I want to have a
    window within my
    > page
    > that will have a scroll bar allowing the visitor to
    scroll throught the
    > text
    > without having to scroll down the whole page.
    > Can I do this through css?
    > Know what I mean?
    >
    > Thanks,
    >

  • Using the middle mouse button to open a link in a new background tab also reloads the current page.

    When I click on a link with the middle button to open the link in a new background tab, the original page reloads and my view jumps to the top each time.
    The new tab loads fine but in order to continue reading the original page I have to scroll down to where the link I clicked on is.
    If I right-click on the link and select "Open Link in New Tab" from the context menu then the behaviour is as expected -- does not reload the original page. The flaw only happens when using the convenient mouse shortcut.
    This is annoying, for example, on long Wikipedia articles where I want to open some of the cited pages in other tabs for reading later whilst I continue to read original article. I'm constantly having to find where I was in order to continue reading.
    I've observed this behaviour on both Windows XP and Ubuntu on various computers.
    [EDIT]: Better description of problem in title.

    I've never had that happen with Firefox 4 on WinXP. I haven't updated my Netbook that runs Ubuntu to Firefox 4 yet.
    1. Try disabling the Java Console 6.0.24 and the Java Quick Starter 1.0 extensions and see if that solves your middle-click problem.
    2. Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most Add-ons.''
    ''(If you're not using it, switch to the Default Theme.)''
    # You can open the Firefox 4.0 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • How to align flash content to the middle of the screen in browser?

    I am currently building a website in flash cs5.5 using AS2.0. One of the pages is 1024px wide by 1536 height. I want the screen to show only the first half of the screen and then the user has to scroll down using the browser scrollbar to see the second half of the screen.
    Below is the html code. I have changed the 'overflow' from hidden to auto so that the website is scrollable. However when i preview the website in the browser, it is aligned to the left. Even though below (highlighted in red) it says 'middle'. This is not what i want, i want the website to me aligned in the middle so that there is a border on either side of the website.I have tried numerous things to fix it but all to no avail. Could someone please help. Let me know if you need anymore info.
    Thanks
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
      <title>aboutus</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <style type="text/css" media="screen">
      html, body { height:100%; background-color: #333333;}
      body { margin:0; padding:0; overflow:auto; }
      #flashContent { width:100%; height:100%; }
      </style>
    </head>
    <body>
      <div id="flashContent">
       <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1024" height="1536" id="aboutus" align="middle">
        <param name="movie" value="aboutus.swf" />
        <param name="quality" value="best" />
        <param name="bgcolor" value="#333333" />
        <param name="play" value="true" />
        <param name="loop" value="true" />
        <param name="wmode" value="window" />
        <param name="scale" value="showall" />
        <param name="menu" value="true" />
        <param name="devicefont" value="false" />
        <param name="salign" value="" />
        <param name="allowScriptAccess" value="sameDomain" />
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="aboutus.swf" width="1024" height="1536">
         <param name="movie" value="aboutus.swf" />
         <param name="quality" value="best" />
         <param name="bgcolor" value="#333333" />
         <param name="play" value="true" />
         <param name="loop" value="true" />
         <param name="wmode" value="window" />
         <param name="scale" value="showall" />
         <param name="menu" value="true" />
         <param name="devicefont" value="false" />
         <param name="salign" value="" />
         <param name="allowScriptAccess" value="sameDomain" />
        <!--<![endif]-->
         <a href="http://www.adobe.com/go/getflash">
          <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
         </a>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
       </object>
      </div>
    </body>
    </html>

    #flashContent {    
    width: 1024px;
    margin-left: auto;
    margin-right: auto;
    Get rid of the 100% w/h and give flashContent a set width (1024).
    Then you can give the right and left an auto margin... centering the <div id="flashContent">.
    Best wishes,
    Adninjastrator

  • How do I change what the middle mouse button/wheel does?

    I feel like an idiot asking this, but I can't figure this out...
    I've plugged in a bog standard 2 button + scroll wheel third button mouse, but I can't get the middle mouse button/wheel to behave like it would in Windows.  If I click it, it changes programs, hold it it brings up the task switcher thing.  It's like I'm pressing command + tab.
    I want it to work normally, where the program I'm using the middle button responds, not the OS.  Like in Firefox, I want to be able to close tabs with the middle mouse button, and open new links with it...instead all it can do is switch programs.
    Is there a way to do this?  Am I missing something obvious?

    Err...I don't know what happened, but I rebooted and now it's working like normal (knock on wood!).  Noooo idea how it ended up in that state!

Maybe you are looking for

  • Follow-up - Loading forms

    Listed below are details on my original problem. One solution I am trying has been to in the connection settings of my browser is to set the proxy to (local, 27.0.0.1) then direct form builder to my browser (firefox) using preferences and selecting r

  • IPhone and Ipad activeSync go crazy

    Hi all, We are experiencing strange problem with some users using iphone and Ipad in our company (We allow users to sync their professional mailbox on their iphone) i will try to be the clearest as possible: we have multiple exchange CAS server, our

  • Customer Service Number

    I am having a major issue with Skype right now... I TRIED to pay for a Skype number along with a 3 month subscription for $18.00... and something went wrong on PayPal's side and the payment never went through... So then I called PayPal and they said

  • UDP FLOODING and NON-FUNCTIONAL INBOUND LOG

    Hello, I have been using Linksys Routers since 1998, IIRC. I just bought a new "Cisco" (LINKSYS) E1200 and the INBOUND log does not work, even after activation the log function in the "Administration" area. The OUTBOUND log works. Also, my desktop wo

  • Running Action Recorded In PS

    Rather than scripting the action out in code, I'd like to run my action already recorded in PS CS4. Anyone have an example on how this can be done?