I have created a swing application where i have used jtabbedpane. Since the jtabbed pane was too big and required scrolling, i enclosed the jtabbed pane with jscroll pane by right clicking jtabbed pane, ->Enclose in -> jscrollpane. Now, the problem is, i want to remove this jscrollpane. how do i do this?
Note: short / long in terms of how long it takes to follow the advice
This is probably the real answer -- it sounds like you're using a visual editor so it's difficult to tell you how to remove it (especially since we don't know which editor you are using). Most likely, the editor is creating a JTabbedPane object and then passing the object to a JScrollPane. The easiest thing to do is to switch your editor to allow you to manually modify the code and remove the JScrollPane.
I have pasted an example below of some code that I wrote to embed a JTextArea into a JScrollPane. Without it, the text area cannot be scrolled. The line that embeds the JTextArea object (named textArea) is just below the comment...should be pretty obvious. The object is passed to the constructor of JScrollPane. After that it's just a bunch of options being configured. You might be able to locate the point in your generated code where the JTabbedPane object gets embedded into a JScrollPane and just remove it manually. In my code below this would mean that I remove the JScrollPane named areaScrollPane (and all associated lines where I'm invoking methods of it).
I dislike the use of visual designers for creating a trivial GUI (the only kind I've ever created ) and I don't use Matisse, but I opened up a project I have stashed away (aptly named throwaway) and it tool me less than 10 minutes to figure out how to do this, in the Inspector pane.
No, I'm not saying more. This forum is for Swing, not Matisse.
Joined: Dec 21, 2010
Actually I am in hurry and can't go through the tutorial right now. As I have to submit this project soon, i want to fix this problem without manually coding. Please, suggest a way to do this using swing gui editor.
Since the question is now in the correct place -- in the Inspector window, drag the node for the JTextArea and drop it where it is no longer a child node of the JScrollPane.
But. Just remember that a visual designer like Matiss is most emphatically not a beginner's tool. You can learn Swing from online resources, but if you haven't a clue about Swing, you cannot learn to use a visual designer effectively.
Actually I am in hurry and can't go through the tutorial right now.
You can't afford not to. As you've experienced with this problem, you'll waste more time using a sophisticated tool that is several times more difficult to learn than Swing coding.
subject: Swings - Remove the jscrollpane of enclosed jtabbedpane