![JAR search and dependency download from the Maven repository](/logo.png)
com.fathzer.soft.ajlib.swing.dialog.DefaultScrollablePanel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ajlib Show documentation
Show all versions of ajlib Show documentation
AJlib is a simple java library with Swing widgets, utilities and other stuff
package com.fathzer.soft.ajlib.swing.dialog;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Rectangle;
import javax.swing.JPanel;
import javax.swing.Scrollable;
/**
* @author Jean-Marc Astesana
* License: LGPL v3
*/
@SuppressWarnings("serial")
class DefaultScrollablePanel extends JPanel implements Scrollable {
DefaultScrollablePanel(Component component) {
super(new BorderLayout());
this.add(component);
}
@Override
public Dimension getPreferredScrollableViewportSize() {
return this.getComponent(0).getPreferredSize();
}
@Override
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
return 10;
}
@Override
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
return 40;
}
@Override
public boolean getScrollableTracksViewportWidth() {
return true;
}
@Override
public boolean getScrollableTracksViewportHeight() {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy