473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Scrollbar

80
Hi friends

How can i add a vertical and horizontal scroll bar inside a Textarea..
While i created a textarea i cant read the topics down the screen ...
i add a scrollbar but it seperates from textarea , i want to attach that scrollbar with my textarea how is it possible...

Expand|Select|Wrap|Line Numbers
  1. JTextArea area = new JTextArea(40,40);
  2. JScrollBar scr = new JScrollBar();
  3.  
  4.  
i call this textarea and scrollbar inside a panel...but it seperates ...
Apr 12 '07 #1
5 3272
JosAH
11,448 Expert 8TB
Hi friends

How can i add a vertical and horizontal scroll bar inside a Textarea..
While i created a textarea i cant read the topics down the screen ...
i add a scrollbar but it seperates from textarea , i want to attach that scrollbar with my textarea how is it possible...

Expand|Select|Wrap|Line Numbers
  1. JTextArea area = new JTextArea(40,40);
  2. JScrollBar scr = new JScrollBar();
  3.  
  4.  
i call this textarea and scrollbar inside a panel...but it seperates ...
Let the TextArea determine for itself whether or not it needs scrollbars. There's
a contructor that does the job:

public TextArea(String text, int rows, int columns, int scrollbars)

... also have a look at the API docs for this class.

kind regards,

Jos

ps. are you sure you don't want Swing's JTextArea instead?
Apr 12 '07 #2
reon
80
I tried something with JScrollPane , trying,but didnt completed..
i am using swing from javax and awt from java...

public TextArea(String text, int rows, int columns, int scrollbars)
would you please tell me wats the use of String text.bcoz i think textarea needed int columns and rows...wats the use of string there...

Let the TextArea determine for itself whether or not it needs scrollbars. There's
a contructor that does the job:

public TextArea(String text, int rows, int columns, int scrollbars)

... also have a look at the API docs for this class.

kind regards,

Jos

ps. are you sure you don't want Swing's JTextArea instead?
Apr 12 '07 #3
JosAH
11,448 Expert 8TB
public TextArea(String text, int rows, int columns, int scrollbars)
would you please tell me wats the use of String text.bcoz i think textarea needed int columns and rows...wats the use of string there...
Did you read the API docs for this constructor? I bet you didn't.

kind regards,

Jos
Apr 13 '07 #4
The way i have used it before isnt probably the best way but it works. You can add the textarea to the scrollbar. And then the scrollbar to the panel.

i think its just one of the scrollbar.add() method.

BSCode266
Apr 13 '07 #5
JosAH
11,448 Expert 8TB
The way i have used it before isnt probably the best way but it works. You can add the textarea to the scrollbar. And then the scrollbar to the panel.

i think its just one of the scrollbar.add() method.

BSCode266
That's not necessary: the TextArea can take care of all that itself. See my
previous replies.

kind regards,

Jos
Apr 13 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Sujan | last post by:
Hello all, Is it possible to remove scrollbar(s) without using frames. Is there any code which could be applied in body tag to remove scrollbar(s). Thanks in adv, Sujan
4
by: Price Brattin | last post by:
I dragged a datagrid onto a VB.Net WinForm and used the properties page and a few lines of code to set it up, including the DataSource. No wizard setup was used. It works fine except for one...
9
by: kjs | last post by:
Is there any was to control the color of the scrollbars when using the 'overflow: scroll' attribute? TIA, Karl
0
by: h-h | last post by:
BODY { scrollbar-face-color: #f5f5f5; scrollbar-highlight-color: #666666; scrollbar-shadow-color: #666666; scrollbar-3dlight-color: #ffffff; scrollbar-arrow-color: #666666;...
1
by: Shun | last post by:
Hello, How to the add a blue color scrollbar to the browser Left and bottom. Thanx Shun
0
by: d.steininger | last post by:
Hi there! Is there a way to bind a Textbox.Text to a ScrollBar.Value (not the Textbox-own Scrollbar) and vice versa? The Problem: I have to deal with two controls. The Textbox should accept...
14
by: Michael Weis | last post by:
Hello all, as a non-professional in these things, I searched for this topic but found no satisfying answer: I have to create a site with 3 frames. (Please no diskussion about the sense of...
2
by: kurt sune | last post by:
How do I render the scrollbars by CSS in a listbox? I have understood that an asp listbox gets rendered as a select element. So I tried first by adding a style element: ..TA...
3
by: nicky77 | last post by:
Hi, before you say it i know frames are bad practice - but i'm developing dynamic content on a site which has already been designed, so alas there's no option but to use them. Anyway, I just want to...
1
by: Tom | last post by:
First, I posted a similar request for help in another group and now don't find the posting. Problem with my newsreader perhaps ... but apologies if this appears as a cross posting. My code is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.