can anyone tell me the code how to create a textpane with scrollbars inside a tabbed pane.....and i should save the text in a file on button click....
britto
0
Junior Poster in Training
Recommended Answers
Jump to PostYou need to use a JTextArea for this, you can specify the no. of rows and columns for the JTextArea by using the methods
setRows()
andsetColumns()
. When you set the JTextArea's rows and columns to more than the width and height assigned for the JTextArea horizontal and vertical …
Jump to PostFor this you would have to implement the ChangeListener Interface's
stateChanged()
method, which would be invoked whenever the tabbed panes state has been changed, which includes the changing of the active tab from one to another.
When this happens, you can use thegetAccessibleContext()
method to get the name of …
Jump to PostSetting the rows and cloumns alone will not get the scroll bars for you, if you read my earlier post carefully, I have mentioned there that setting the Rows and Columns for the JTextArea will set the total size of the JTextArea, where Rows will specify how many lines of …
Jump to Posti need to add tabs dynamically to the tabbedpane every tab will have jtextarea as component i tried this but everytime i click the button the first tab alone is changed..
tabbedpane=new JTabbedPane();
tabbedpane.addtab("new tab",null,textArea,null);That is because every time you press the button a new JTabbedPane is created replacing …
Jump to PostRather then having
tabbedPane.addTab("tab",new ScrollPane(new JTextArea()),null);
you should go asJTextArea jta = new JTextArea(); JScrollPane jsp = new JScrollPane(jta); tabbedPane.addTab("TAB_NAME", jsp);
in doing so you can either call jta directly if from same class or provide appropriate setter and getter methods for access from outside …
All 22 Replies
verruckt24
438
Posting Shark
britto
0
Junior Poster in Training
verruckt24
438
Posting Shark
britto
0
Junior Poster in Training
verruckt24
438
Posting Shark
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
britto
0
Junior Poster in Training
britto
0
Junior Poster in Training
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.