?
Solved

arranging image icon and JScrollPane horizontally and more...

Posted on 2004-04-12
7
Medium Priority
?
195 Views
Last Modified: 2010-03-31
Hi!

I am trying to arrange image icon and JScrollPane horizontally. This is a sample site.

http://webdev.apl.jhu.edu/~rbe/java/Homework5/index.html

****************************************
    JLabel explanatoryArea = new JLabel("This is a explanatory area.");
    scrollPane = new JScrollPane(explanatoryArea);
    scrollPane.setPreferredSize(new Dimension(50, 60));
    container.add(scrollPane, BorderLayout.NORTH);

***********************************
Also, if I want my text start from left top corner in the scrollpane, how do I do it?
I don't think JLabel is the way...

thanks,
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10810650
You probably want to look into JTextArea.
0
 

Author Comment

by:dkim18
ID: 10818052
This question is not about JTextArea, but arranging icon and jscrollpane just like sample.
(if you resize the sample wizard, you will know it is scrollpane.)
0
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 500 total points
ID: 10818292
Look into the various layout managers.

The dialog showing in the example I would have made out of 2 JPanels. 1st panel at top with the icon and text using FlowLayout. 2nd panel at bottom, Flowlayout again. Using BorderLayout for the main panel. JLabel is an excellent way of showing an image icon.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10820998
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question