Solved

Maximize window ---> TextEdit take new window size

Posted on 1998-02-12
1
215 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
couple of eclipse 5 52
maven not picking latest jar instead picking old jar from .m2 12 42
passing enum to a method 4 34
Java Inheritance super keyword use 8 30
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

685 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