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?

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>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.