Hi,

I have a GUI with a JTabbedPane. In the tabbedpane I used a JScrollPane to hold a JTextPane. How can I get the object name of JTextPane that I have created in my class or something which is unique for a jcomponent with which I can identify that the selected pane is the one I needed?....

Is there any method for that in Java?

Can anybody help me in this issue.... Its urgent... Plzzzzzzzz

Thanks in advance....

Recommended Answers

All 2 Replies

What in your terminoly is an "object name"

tabbedPane.getSelectedIndex() will tell you which pane is visible

What in your terminoly is an "object name"

tabbedPane.getSelectedIndex() will tell you which pane is visible

According to my requirement, I am using three JTextPanes naming jTextPane1 for showing static data, jTextPane2 for showing vbscript and jTextPane3 for another purpose. Now a new requirement come to me that the txtpane for showing static data means, jTextPane2, should be editable at certain condition. And also that must be saved. Now the problem arises. Is there any way to get the name "jTextPane2" to identify the textPane I needed....

I have used the solution you have send to me earlier. But it not works perfectly for me...

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.