0

Now I study about GUI (awt&swing) in java. But I don't know how can I make scroll bar. I try to find about that matter but still i don't get it. Could you give me simple explanation and example to create it.

Thank you . I am sorry for my bad English.

1

2 Answers 2

3

Java offers the JScrollPane object for this sort of thing. Here is the documentation.

Here is a tutorial provided by Oracle on how to use them.

Example

JTextArea t = new JTextArea("This is some text");
JScrollPane s = new JScrollPane(t);
this.add(s); // Adds the scollpane to the parent container.
Sign up to request clarification or add additional context in comments.

Comments

0

here is a example for swing scroll bar

and here is an example for awt scroll bar

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.