Example usage for javax.swing JScrollPane invalidate

List of usage examples for javax.swing JScrollPane invalidate

Introduction

In this page you can find the example usage for javax.swing JScrollPane invalidate.

Prototype

@Override
public void invalidate() 

Source Link

Document

Invalidates the container.

Usage

From source file:com.nvinayshetty.DTOnator.FeedValidator.JsonFeedValidator.java

private void showAlert(JScrollPane exceptionLoggerPane, JLabel exceptionLabel, JSONException ex1) {
    exceptionLoggerPane.setVisible(true);
    exceptionLabel.setVisible(true);//from   ww  w  .j  a va  2 s .c o  m
    new ExceptionLogger(exceptionLabel).Log(ex1);
    exceptionLoggerPane.invalidate();
    exceptionLoggerPane.validate();
    exceptionLoggerPane.repaint();
}

From source file:KjellDirdalNotepad.java

public void setNormalSize() {
    JScrollPane scrollPane = getScrollPane();
    int x = 0;// w w w  .  j  a v  a2s  .co  m
    int y = 0;
    Insets scrollInsets = getScrollPaneInsets();

    if (scrollPane != null) {
        Dimension d = scrollPane.getVisibleRect().getSize();
        if (scrollPane.getBorder() != null) {
            d.setSize(d.getWidth() - scrollInsets.left - scrollInsets.right,
                    d.getHeight() - scrollInsets.top - scrollInsets.bottom);
        }

        d.setSize(d.getWidth() - 20, d.getHeight() - 20);
        desktop.setAllSize(x, y);
        scrollPane.invalidate();
        scrollPane.validate();
    }
}

From source file:KjellDirdalNotepad.java

protected void resizeDesktop() {
    int x = 0;/*from   w w  w. ja  v  a  2  s .c om*/
    int y = 0;
    JScrollPane scrollPane = getScrollPane();
    Insets scrollInsets = getScrollPaneInsets();

    if (scrollPane != null) {
        JInternalFrame allFrames[] = desktop.getAllFrames();
        for (int i = 0; i < allFrames.length; i++) {
            if (allFrames[i].getX() + allFrames[i].getWidth() > x) {
                x = allFrames[i].getX() + allFrames[i].getWidth();
            }
            if (allFrames[i].getY() + allFrames[i].getHeight() > y) {
                y = allFrames[i].getY() + allFrames[i].getHeight();
            }
        }
        Dimension d = scrollPane.getVisibleRect().getSize();
        if (scrollPane.getBorder() != null) {
            d.setSize(d.getWidth() - scrollInsets.left - scrollInsets.right,
                    d.getHeight() - scrollInsets.top - scrollInsets.bottom);
        }

        if (x <= d.getWidth())
            x = ((int) d.getWidth()) - 20;
        if (y <= d.getHeight())
            y = ((int) d.getHeight()) - 20;
        desktop.setAllSize(x, y);
        scrollPane.invalidate();
        scrollPane.validate();
    }
}