?
Solved

Maximize window ---> TextEdit take new window size

Posted on 1998-02-12
1
Medium Priority
?
223 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 200 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

839 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