Solved

Maximize window ---> TextEdit take new window size

Posted on 1998-02-12
1
210 Views
Last Modified: 2006-11-17
HI,

I am developping a text editor with IBM VA for Java. I am new to this environment. When I maximize the window (a frame), I want the textedit control it to take all the new space automatically. How can I do that?
0
Comment
Question by:pjroy
1 Comment
 
LVL 2

Accepted Solution

by:
shogi earned 50 total points
ID: 1233035
Nothing exist in the the basic set of Java.  So what you have to program the componentResized event and program the new space of you textedit or any others controls.

class SymComponent extends java.awt.event.ComponentAdapter
{
public void componentResized(java.awt.event.ComponentEvent event)
{
  Object object = event.getSource();
  if (object == Frame1.this)
     Frame1_ComponentResized(event);
}
}

void Frame1_ComponentResized(java.awt.event.ComponentEvent event)
{
  // example write in a label the size of the Frame.
label1.setText("The size of the Frame is   " +                  (event.getComponent()).getSize());
}

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now