473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

disposing a jframe from keyboard

36
how can i dispose a JFrame from keyboard.???
Apr 25 '08 #1
8 1651
JosAH
11,448 Expert 8TB
how can i dispose a JFrame from keyboard.???
I don't understand your question: a JFrame is supposed to be displayed on your
screen, not on your keyboard. Did it fall off?

kind regards,

Jos
Apr 25 '08 #2
r035198x
13,262 8TB
I don't understand your question: a JFrame is supposed to be displayed on your
screen, not on your keyboard. Did it fall off?

kind regards,

Jos
You are supposed to guess that they want to close the JFrame using a keyevent.


P.S If the JFrame falls of my screen, it won"t fall on my keyboard too. They are about 10 cm apart.
Apr 25 '08 #3
JosAH
11,448 Expert 8TB
You are supposed to guess that they want to close the JFrame using a keyevent.


P.S If the JFrame falls of my screen, it won"t fall on my keyboard too. They are about 10 cm apart.
I have a laptop so if a JFrame falls off my screen it slides down on the keyboard;
if my keyboard happens to be a bit slippery it'll slide even further and drops down
off the table in my lap *yuck*. I'll go and implement a fast SuperGlue class now ...

kind regards,

Jos ;-)
Apr 25 '08 #4
pankajs
36
I was meant to say that there is method setCloseDefaultCloseOperation(DISPOSE_ON_CLOSE); ie. when we click close at right top it closed.My ques. was how can it be done by keyevent??????
Apr 25 '08 #5
r035198x
13,262 8TB
I was meant to say that there is method setCloseDefaultCloseOperation(DISPOSE_ON_CLOSE); ie. when we click close at right top it closed.My ques. was how can it be done by keyevent??????
The first step is to read about the subject.
Apr 26 '08 #6
pankajs
36
I was meant to say that there is method setCloseDefaultCloseOperation(DISPOSE_ON_CLOSE); ie. when we click close at right top it closed.My ques. was how can it be done by keyevent??????

i couldn't find any solutn.. Please..
Apr 28 '08 #7
r035198x
13,262 8TB
I was meant to say that there is method setCloseDefaultCloseOperation(DISPOSE_ON_CLOSE); ie. when we click close at right top it closed.My ques. was how can it be done by keyevent??????

i couldn't find any solutn.. Please..
Did you read my reply above?
Apr 28 '08 #8
BigDaddyLH
1,216 Expert 1GB
Usually, if you want to provide the user with a close action, you create a "close" menu item. Then the keyboard binding follows from the menu item's accelerator:

http://java.sun.com/docs/books/tutor...ents/menu.html
http://java.sun.com/javase/6/docs/ap...ing.KeyStroke)
Apr 28 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tuno | last post by:
I'm relatively new to Java Swing programming. I have a console application that processes text files and while doing so I want to suspend the execution when an error is encountered that requires...
5
Shinzon
by: Shinzon | last post by:
ok so far I have got: JFrame frame = new JFrame( "Matt's DVD's" ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); frame.setSize( 420, 170 ); // set frame size ...
5
Shinzon
by: Shinzon | last post by:
Ok so I have been working on this for a moment now and wondering how to add multiple jlabels to a jframe. the code looks like this: JLabel jl = new JLabel("DVD ID #= " + dvd); //Displays DVD...
3
by: coffeetime | last post by:
Hi, I just decided to learn java, so I'm quite a noob. I use the book learning java third edition. have JDK 1.6 program in notepad. I have made the simple HelloJava example, and now i wanted to...
3
by: coffeetime | last post by:
Hi, I just decided to learn java, so I'm quite a noob. I use the book learning java third edition. have JDK 1.6 program in notepad. I have made the simple HelloJava example, and now i wanted to...
2
by: zahit | last post by:
hi guys, my line doesn't appear on the frame. what's the problem? import java.util.*; import java.io.*; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.*; public class...
6
by: gaya3 | last post by:
Hi, I need to make the frame invisible on action event in swings. I have the following code: public class sample_pgm extends JFrame{ public void sample() { JFrame jf =...
1
by: Gimzo | last post by:
Hi, I'm trying to create a button that opens a new window for setting up a whole crapload of constants for an analysis program. For this, I have a JButton. The actionPerformed-method activates...
1
by: sibusiso | last post by:
HI Can anyone help with the scenario where where you have to pass a certain data from one JFrame to another. For example, suppose you have a JFrame is your main window you disabled your Jmenu...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.