aspose file tools
The moose likes Swing / AWT / SWT and the fly likes  Scrolling Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark " Scrolling Problem" Watch " Scrolling Problem" New topic
Author

Scrolling Problem

nabi bux
Ranch Hand

Joined: Mar 14, 2005
Posts: 73
High e=very Body
I have the following code problem occure
The scrolling done only the size of monitor
means contrl that exeed the size of moniotor not
visible
please tell me
thank
suppose iHave program having 1000 text boxes how can i
visualize these all when i am trying to get them
only 14 are but no more
if i use build in scrooling it is not working
user defined layout which i used
please help me how can i use it
Thankd i have the foloowing code




import java.awt.*;
import javax.swing.*;
import java.net.*;
import java.awt.event.*;


class SDemo2
{
static JScrollBar sv;
static JPanel p;
static JViewport jvp;


public static void main(String a[])




{

JScrollPane j ;
jvp=new JViewport();
sv =new JScrollBar(JScrollBar.VERTICAL,0,0,0,600);
p=new JPanel();

p.setLayout(null);

JFrame f=new JFrame();
JButton b[]=new JButton[100];
//JTextField b[]=new JTextField[90];
int y=10;

for(int i=0; i<15; i++)
{
b[i]=new JButton("High");

b[i].setBounds(10,y,100,50);
y=y+40;

p.add(b[i]);
}



jvp.add(p);
f.getContentPane().add(jvp,BorderLayout.CENTER);
f.getContentPane().add(sv,BorderLayout.EAST);


f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);
f.setSize(500,500);


sv.addAdjustmentListener(new AdjustmentListener()
{
public void adjustmentValueChanged( AdjustmentEvent e)
{

JScrollBar h=(JScrollBar)e.getSource();


Point pt=jvp.getViewPosition();
pt.y=e.getValue();

jvp.setViewPosition(pt);


}});



}




}




 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Scrolling Problem
 
Similar Threads
ScrollPane to top - that old chesnut...
JTextFields & storing data
JVeiwporterror
Problem with custom painting and multiple JPanel
Selecting text