All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fathzer.soft.ajlib.swing.dialog.DefaultScrollablePanel Maven / Gradle / Ivy

Go to download

AJlib is a simple java library with Swing widgets, utilities and other stuff

There is a newer version: 0.3.16
Show newest version
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