0

Hi,
I would like to make a window with a given size, and a scrollable textarea to a given place within.

When I tried the same with a button instead of textarea, it was no problem: make a JFrame, put a JPanel inside, put a JButton on the panel. Then call myPanel.setLayout = null to kill the layout manager, and myButton.setBounds(...) to place the button where I want.

The problem is, I tried to use a JScrollPane and a JTextArea in the same way, but setting myScrollPane.setLayout = null makes the scrollbar not appear. If I do use the layout manager, the scrollbar does appear, but the attempts to force the placement usually ended in strange results.

Do you have any idea how to fix it?

2
Contributors
1
Reply
4
Views
4 Years
Discussion Span
Last Post by subhraakasuny
0

you can add a id to the text area,and add the follwing attribute for the corresponding id in the head tag like

<html>
<head>
#scrolltext
    {
        overflow: scroll; 
        overflow-y: scroll; 
        overflow:-moz-scrollbars-vertical;
    }


</head>
<body>
<textarea rows="4" cols="20" id="scrolltext"> </textarea>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.