Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question for Martinag  

Posted on 1998-11-15
10
Medium Priority
?
175 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 80 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

604 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