We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Hoc to get the current position of a JTextArea
Page Index Toggle Pages: 1
Hoc to get the current position of a JTextArea (Read 764 times)
Hoc to get the current position of a JTextArea
Jun 22nd, 2009, 12:18am
 
Hello,

I don't know if this is the right place for my questions because they are more Java problems in a processing code.

I have a small Programm with a JTextArea that should display two languages.
The first problem was to display in the JTextArea s name field wich language is selected. I solved the problem by dispose (close) the JTextArea and open a new one with the other name. This works but looks not so nice. Is there a better solution to do this?
The second problem is, that the new JTextArea is at an other position then the first. I  know how to give the JTextArea a position and size... but if the user replaces the position the second window should open at exactly the same position like the first window was.
The commandos:
     editor.gedPosition();
     editor.getColumnWidth;
     editor.Editor_width;
     ...
give just the level back witch was declared in the beginning. They don't say anything about the changes witch where made by the user.
Does anybody know how to get the current size and position of a JTextArea?

There is a third problem in my project. I prefer to have just one window opened on the desktop. At the moment there is a JTextArea and an empty processing window. Is it possible to make the empty Processing window invisible?


Thanks for replies

Re: Hoc to get the current position of a JTextArea
Reply #1 - Jun 23rd, 2009, 10:56am
 
You might consider a JTabbedPane component, this would allow each of the 2 JTextAreas to be in their own tab. You can add a ChangeListener to the JTabbedPane so you know when a tab has been clicked.

Quote:
Is it possible to make the empty Processing window invisible?


It seems to me that you are creating a Java Swing application and if you don't need to see the Processing window why use Processing.

If you are creating Swing applications then Java Netbeans is a much better IDE to develop them. Smiley
Page Index Toggle Pages: 1