Solved

Maximize window ---> TextEdit take new window size

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars2 challenge 6 70
What is JNDI datasource in spring 1 38
topping3 challenge 14 51
wordcount challenge 11 78
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

760 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

20 Experts available now in Live!

Get 1:1 Help Now