Solved

Question for Martinag  

Posted on 1998-11-15
10
172 Views
Last Modified: 2012-05-04
Hi, Martinag:
Thank you for your help!  Could you please tell me how to create a window without the "Minimize", "Maximize" and "Exit" icons at the right top of the window? I use JDK1.1.6. Thanks!
0
Comment
Question by:leeann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 

Author Comment

by:leeann
ID: 1227513
Edited text of question
0
 
LVL 4

Accepted Solution

by:
martinag earned 20 total points
ID: 1227514
I'm sorry to tell you but I don't think it's possible. Maybe it'll be when Swing is released but then you'll have to upgrade your JDK.

Martin
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1227515
What about java.awt.Window ?

'A Window object is a top-level window with no borders and no menubar. It could be used to implement a pop-up menu. The default layout for a window is BorderLayout. A Window object blocks input to other application windows when it is shown. '

  heyhey
0
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!

 
LVL 4

Expert Comment

by:martinag
ID: 1227516
leeann, heyhey_ is right. You can reject my answer and give heyhey_ the points.

Martin
0
 

Author Comment

by:leeann
ID: 1227517
Could you please tell me how to create a window object in my application program?

0
 
LVL 4

Expert Comment

by:martinag
ID: 1227518
Window w = new Window(new Frame());
w.add(new Button("Add components in the same way as with the java.awt.Frame"));
w.pack();
w.show();

You'll have to add the border (if you want one) on your own but that should not be hard.

Martin
0
 

Author Comment

by:leeann
ID: 1227519
I felt a little confuse here.  Are the following codes correct?
public class MainMenu extends Window {
   public MainMenu(){
     add(new Button("Add components in the same way as with the java.awt.Frame"));
      pack();
      show();
      ReportFrame rf = new ReportFrame(this);    //create a new frame
   }
  ...
}
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1227520
>>      ReportFrame rf = new ReportFrame(this);    //create a new frame

you don't have to create a new Frame. Window object is a top-level window so .show() should be enough.
0
 

Author Comment

by:leeann
ID: 1227521
But I need to create a new frame in the MainMenu. Is there a way to create a frame without  the "Minimize" and "Maximize"  icons (or both
of them are disabled. Now I have a small test program which does not allow the user enlarge the frame, but looks very confuse. Here are the codes:

import java.awt.event.*;
import java.awt.*;

public class Resize {

 public static void main(String args[]) {
  new ResizeFrame();
 }
}

class ResizeFrame extends Frame {

 ResizeFrame() {
  super();

  addComponentListener(new ComponentAdapter() {
   public void componentResized(ComponentEvent evt) {
    setSize(200,200);}});

  /* Add the window listener */
  addWindowListener(new WindowAdapter() {
   public void windowClosing(WindowEvent evt) {
    dispose(); System.exit(0);}});

  /* Size the frame */
  setSize(200,200);

  /* Center the frame */
  Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
  Rectangle frameDim = getBounds();
  setLocation((screenDim.width - frameDim.width) / 2,(screenDim.height - frameDim.height) / 2);

  /* Show the frame */
  setVisible(true);
 }
}

 
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1227522
1. I don't think you can create a Frame without the Mac\ximazi, Minimize, etc. buttons (but you can just checjk the java.awt.Frame docs)
2. isn't there Frame.isResizable and setResizable methods

(working from memory)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

733 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