Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

Creating a JSplitPane

Thread view: 
Stefan Lintner - 11 May 2005 09:51 GMT
Hi,

I would like to crate a JSplitPane. I read the Sun Tutorial at
http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html .
Now I am using the code of the first expample, but it doesn't work. Java
1.5 shows 8 errors... "cannot find symbol":

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

import java.util.*;

public class GuiAufbauen implements ListSelectionListener {

private JSplitPane splitPane;

public static void main(String[] args) {
//Create a split pane with the two scroll panes in it.
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane,
pictureScrollPane);
splitPane.setOneTouchExpandable(true);
splitPane.setDividerLocation(150);

//Provide minimum sizes for the two components in the split pane
Dimension minimumSize = new Dimension(100, 50);
listScrollPane.setMinimumSize(minimumSize);
pictureScrollPane.setMinimumSize(minimumSize);
}
}
===

Thanks for your help!
Michael Rauscher - 11 May 2005 10:19 GMT
Hi Stefan,

Stefan Lintner schrieb:

> Hi,
>
> I would like to crate a JSplitPane. I read the Sun Tutorial at
> http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html .
> Now I am using the code of the first expample, but it doesn't work. Java
> 1.5 shows 8 errors... "cannot find symbol":

The codes that are embedded in the tutorial's text are (mostly) snippets
and not complete examples.

You'll find the complete source code in the example index (there's a
link to the example index near every example ;-) ).

The file you'll need is the one here:

http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/SplitPa
neDemo.java


Bye
Michael
Stefan Lintner - 11 May 2005 21:08 GMT
Michael Rauscher schrieb:
> The file you'll need is the one here:
> http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/SplitPa
neDemo.java
 

Thats a lot of code... isn't it possible to implement a JSplitPane in an
easier way? :)
Michael Rauscher - 12 May 2005 00:56 GMT
Stefan Lintner schrieb:
> Michael Rauscher schrieb:
>
[quoted text clipped - 3 lines]
> Thats a lot of code... isn't it possible to implement a JSplitPane in an
> easier way? :)

Sure:

JSplitPane p = new JSplitPane();

Then set the left (right) component using p.setLeftComponent and
p.setRightComponent respectively.

Bye
Michael


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.