JScrollPane Corner : ScrollBar « Swing JFC « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JDK 6
25.JNDI LDAP
26.JPA
27.JSP
28.JSTL
29.Language Basics
30.Network Protocol
31.PDF RTF
32.Reflection
33.Regular Expressions
34.Scripting
35.Security
36.Servlets
37.Spring
38.Swing Components
39.Swing JFC
40.SWT JFace Eclipse
41.Threads
42.Tiny Application
43.Velocity
44.Web Services SOA
45.XML
Java » Swing JFC » ScrollBarScreenshots 
JScrollPane Corner
JScrollPane Corner
  
import java.awt.BorderLayout;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;

public class CornerSample {
  public static void main(String args[]) {
    JFrame frame = new JFrame("Cornering Sample");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Icon miniLogo = new ImageIcon("logo.gif");
    Icon acrossLogo = new ImageIcon("logo-across.jpg");
    Icon downLogo = new ImageIcon("logo-down.jpg");
    Icon bookCover = new ImageIcon("puzzlebook.jpg");
    JLabel logoLabel = new JLabel(miniLogo);
    JLabel columnLabel = new JLabel(acrossLogo);
    JLabel rowLabel = new JLabel(downLogo);
    JLabel coverLabel = new JLabel(bookCover);
    JScrollPane scrollPane = new JScrollPane(coverLabel);
    scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, logoLabel);
    scrollPane.setColumnHeaderView(columnLabel);
    scrollPane.setRowHeaderView(rowLabel);
    frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
    frame.setSize(300200);
    frame.setVisible(true);
  }
}

           
         
    
  
Related examples in the same category
1.Accessible Scroll Demo Accessible Scroll Demo
2.A quick demonstration of JScrollBar both vertical and horizontalA quick demonstration of JScrollBar both vertical and horizontal
3.JScrollPane: Button Corner SampleJScrollPane: Button Corner Sample
4.Expandable SplitPaneExpandable SplitPane
5.ScrollBar PiecesScrollBar Pieces
6.Listening for Scrollbar Value Changes in a JScrollPane Container
7.Get the default scrollbar policy
8.Make the scrollbars always appear
9.Make the scrollbars never appear
10.JScrollBar and Adjustment event
11.JScrollPane to hold scrollable component
12.Use Adjustment Events in Swing
13.Always display scrollbar
14.How to use scrollbar and react to its actionHow to use scrollbar and react to its action
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.