Focus loss? bad modality? wrong default buttons?
Hi Forté Users,
Can I ask if anyone has experienced any of the following problems?
We are using Forté 3.0.G2 on NT4.0 SP3 using Compaq Deskpro PCs.
1. Occasionally, the modality is lost when a modal child window is
displayed for the first time.
2. Sometimes the closing of a child window doesn't correctly return the
focus to the parent window. This may be related to using the keyboard to
"click" the default button rather than actually clicking with the mouse, but
I'm not sure of that.
3. Also the default button is set correctly when a child window closes,
but the window indicates that a different button is the default button. The
highlighting is on the wrong button.
All these problems happen in both distributed and standalone runs.
I ask because I don't want to waste time with Forté Support if they aren't a
generic problem.
Thanks,
Nick.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
Troubleshooting Update:
If I first import my project using the RH7 WYSIWYG as default
editor, the Russian ToC is produced. I can then change the default
editor, (say, to Word2003 or FrontPage) and the Russian ToC is then
preserved. Very strange!
That still leaves a css problem. On import of a Word file,
the styles belong to some unknown (default?) stylesheet, and
editing and correcting is an intolerable job. Why is the Word
template not being imported to become the RH7 topic template?
Your assistance much appreciated.
Similar Messages
-
Wrong default button in alerts when using 64-bit JRE on Windows
Hi guys,
I'm facing a strange problem.
My environment:
Server:
OAS 10.1.2.2.0 on Linux Suse (32-bit)
Client:
IE8 64-bit on Windows XP 64-bit and Java 1.6.0_18 also 64-bit
When I run a form that opens an alert-window with a default-button (button that has the focus), it sometimes happens, that not the default-button, but another button is activated by default.
I have to repeat:
It only happens sometimes and is hard to reproduce. Within 50 attempts it may happen 5 times or just 1 time.
I never saw that happening with 32-bit JVM.
Anyone else seeing this?
br
MichaelOk... here is what I see:
1. Create a form with an alert and set button 2 as the default
2. Run the form and display the alert. Button 2 has focus (proven by the bold solid line (shadow) and dotted line that surround the button)
3. Open any other app (Notepad, Explorer, etc) and move focus to that app
4. Slide this other app out of the way so that you can see the running form under it.
5. While the other app has current focus, the buttons on the form's alert appear to lose focus (this is expected). However, now button 1 has a bold line (shadow) surrounding it. This gives the appearance that button 1 has focus.
6. Click on the alert box to move focus back to the form. Do not click on the alert buttons.
7. Focus lines are now redrawn on the correct button (button 2).
This is probably not the best behavior, but certainly not something that I would call an area of concern. If what I described here is what you are seeing and you feel that this is a significant issue, I would recommend filing a Service Request with Support (assuming you have a support contract) and request that a bug/defect is filed. You will need to provide a test case and I would recommend that you provide screen shots or a video of what you are seeing. If you have not already applied all the previously mentioned patches, I would not recommend contacting Support until you do so, as this will be the first thing they require you completed anyway. -
Hi,
I've got a simple application that needs a custom "search" dialog.
I've created a subclass of JDialog and it comes up just fine...
Basically I have a JTextField for them to put in the search, a few checkboxes for the options, and two buttons at the bottom of the dialog. The buttons are named "find first" and "find next."
I've seen in many programs that when a dialog comes up and has several buttons, i.e. "yes"/"no", then often it will have one of them selected for you and if you hit [enter] it'll just activate that one. I would like to do this to my "find next" button, but am not sure how to do so.
How do I make my "find next" button be the default for the dialog?
Right now, I have an ActionListener set up on the text field so that if a user hits [enter] in the search box, the "find next" is activated. I think that this isn't the right way to go, though, since the text box has to be focused.
Thanks,
JaredI add this code in the constructor of the JDialog to support a default button when no button has focus. (Note. when a button has focus it automatically becomes the default button)
getRootPane().setDefaultButton( findNextButton );
FocusAdapter resetDefaultButton = new FocusAdapter()
public void focusLost(FocusEvent e)
getRootPane().setDefaultButton( findNextButton );
replaceButton.addFocusListener( resetDefaultButton );
replaceAllButton.addFocusListener( resetDefaultButton );
closeButton.addFocusListener( resetDefaultButton ); -
Set default Button and provide a KeyEvent to a component with focus !!!
What is to do ???
I have following program:
public class DefaultButton extends Frame implements ActionListener
private Button close;
public DefaultButton()
super("Default-Button");
setLayout(null);
setSize(400, 200);
setLocation(150, 100);
setBackground(Color.lightGray);
addWindowListener(new WindowAdapter()
public void windowClosing(WindowEvent e)
setVisible(false);
dispose();
System.exit(0);
// CloseButton
close = new Button("Close");
close.addActionListener(this);
close.setVisible(true);
close.setSize(100, 30);
close.setLocation(290, 160);
add(close);
setVisible(true);
public void actionPerformed(ActionEvent e)
String cmd = e.getActionCommand();
if (cmd.equals("Close"))
setVisible(false);
dispose();
System.exit(0);
public static void main(String [] args)
DefaultButton wnd = new DefaultButton();
}If I click on "Close"-button, the window will be closed. But, if the button "Close" has focus, it schold be possibile to close the window with a press on the Enter-Key? How to do it? How can I provide an KeyEvent to button "Close"?
Tanks for any help.Hi pitalica!
It is possible using KeyListener:
public class DefaultButton extends Frame implements ActionListener, KeyListener {
close.addKeyListener(this);
public void keyPressed(KeyEvent e) {
if ((e.getSource() instanceof Button)
&& (((Button) e.getSource()).getActionCommand == "Close")) {
int kc = e.getKeyCode();
if (kc == KeyEvent.VK_ENTER) {
performs any action
public void keyTyped(KeyEvent e) {}
public void keyReleased(KeyEvent e) {}
I hope it helps. -
Strange behaviour on default button
Hi,
I have a frame which has a default button (the button which automatically gets triggered when enter key is pressed. And I am popping up a modal dialog on the JFrame which also has it's own default button.
The tester kept pressing the enter key for about 10 seconds without taking the finger off the enter key on the modal dialog and randomly the JFrame's default button is getting invoked.
I am setting the dialog as modal, but yet this happens. Do I have code anything else to avoid this thing from happening.
Thank you.What happens when the user selected the default button on the dialog? Does that hide the dialog and give the main frame focus? If so, then you would extect the enter key press to go back and forth.
If that is not the problem, one option would be to disable the default button when you are processing a selection. -
OutlineField and the Default Button
Hello all,
We are currently using the Forte 3.0.G.2. I have recently come
across the situation where I am unable to understand the behavior of the
default button. The situation is this:
Whenever I am including the Outline Field as one of the widgets in
any of my windows that particular window will not respond to the default
button. I am attaching the pex file so you can run the test windows and see
the problem.
Can someone please tell me if I am doing something wrong or is this a
known/unknown bug?
<<DefaultBtn.pex>>
Thanks in advance.
Kamran Shafi
Systems Engineer
EDS Medi-Cal XIX
Phone: (916) 636-1093
Email: [email protected]Hi Kamran!
What happens is that when the focus is on outline fields, the enter key
fires a doubleclick event and ignores the default button. So you need to
capture the doubleclick event and do whatever you want your button to do.
Here's a quote from Forte support
"Unfortunately, this is a documentation issue. The IsDefaultButton only
works when focus is on a simple DataField, because in all of the complex
fields, including TextField, TextEditField, TreeView and ListView as well
as OutlineField, the Enter key has a separate and defined action. On
Tree/ListViews and OutlineFields that is DoubleClick.
You COULD catch the DoubleClick on the OutlineField and post a click event
on the default button, however I'd encourage caution with that, since this
could cause some unexpected behavior if someone were counting on the Enter
(or a mouse double-click) to behave in our standard way."
Andrew Small
Enterprise Distributed Solutions National Practice
BORN Information Services
[email protected] <mailto:[email protected]>
-----Original Message-----
From: Shafi, Kamran [mailto:[email protected]]
Sent: Thursday, July 08, 1999 12:49 PM
To: [email protected]
Subject: OutlineField and the Default Button
Hello all,
We are currently using the Forte 3.0.G.2. I have recently come
across the situation where I am unable to understand the behavior of the
default button. The situation is this:
Whenever I am including the Outline Field as one of the widgets in
any of my windows that particular window will not respond to the default
button. I am attaching the pex file so you can run the test windows and see
the problem.
Can someone please tell me if I am doing something wrong or is this a
known/unknown bug?
<<DefaultBtn.pex>>
Thanks in advance.
Kamran Shafi
Systems Engineer
EDS Medi-Cal XIX
Phone: (916) 636-1093
Email: [email protected]
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
Wrong default layout for a new customer
Hi all,
I hope somebody can share inputs with regards to this issue.
I'm assigning a default layout to one customer group (layout1 for all Group1). When this was done, a list of customer codes were included in the list and each were ticked from that list.
Second layout called layout2 for the setting 'Set &as Default for all BPs (for Whom a Default Layout Has Not Been Assigned).
Scenario: A new customer code is created belonging to Group1.
Issues:
a. This new customer code does not automatically follow the setting on default layout which is layout1. When the layout1 default setting was double
checked, the new customer code was part of the list, but it was not ticked.
b. When document was previewed, it uses the wrong layout2.
c. The user still has to update the layout1 default setting, ticking the tick box from the list for the new customer code, then clicking update in then
layout designer window.
Question: Is this a normal behaviour of the system? I thought that setting it as default for certain customer group will be applicable even to newly created ones under that group.
Regards,
CathyHi,
I am afraid that it is your SAP B1 version current behavior but you may check using demo database. What is your SAP B1 version anyway ? what is your database localization ?
You may try the solution part from one of these notes below:
993486 - 'Set as Default for All BPs' doesn't affect specific BP
Version 5 Validity: 21.01.2011 - active
Language English (Master)
Portuguese
Content: Summary | Header Data | References | Validity
Symptom
Specific printing template for Business Partner can not be changed in attempt to define printing template as a default template for all Business Partners.
Cause
Functionality description
Solution
In order to change a specific default printing template for Business Partner follow the steps below:
1. Choose the required template and press on the 'Set as Default' button.
2. Choose the 'Set as Default for Specified BP' and 'Set as Default for Current User' option.
3. Uncheck the box near the BP name and press on the 'Update' button.
4. Choose the required default template (new template) and press on the 'Set as Default' button.
5. Choose the 'Set as Default for all BP' option.
Other terms
Print Layout Designer, Default Template, Set as Default for All Users,
Set as Default for Current User, Set as Default for All BPs, Set as Default for Specific BP
Header Data
Released On
24.02.2011 20:52:30
Release Status
Released for Customer
Component
SBO-GEN-PLD Print Layout Designer
Other Components
SBO-SH-PLD-A2 Tips and tricks for building PLD templates
Priority
Recommendations/additional info
Category
Consulting
References
This document refers to: SAP Business One Notes
861088
Cannot set a template as default for all users
This document is referenced by: SAP Business One Notes (1)
861088
Cannot set a template as default for all users
Validity
Software Component
Version
SAP BUSINESS ONE
2005 A
2005 A SP01
2005 B
2007 A
2007 B
8.8
2nd note:
861088 - Cannot set a template as default for all users
Version 4 Validity: 04.08.2009 - active
Language English
Content: Summary | Header Data | References | Validity
Symptom
When print previewing,the template used is not default template.
Cause
A template has been defined as default for all users, when previewing this it is not the template which has been set as default for document.
Solution
In order to change to a different default template for all users and all business partners please do the following:
a) "Set as default for specified Business Partner" and "set as default for current user"
b) Add tick for this Business Partner
c) Update by ticking again the specific Business Partner
d) Change set as default for all users and all Business Partner's
Other terms
Print Layout Designer, Default Template, All users, Set as Default template, SAP Business One
Header Data
Released On
04.08.2009 11:28:58
Release Status
Released for Customer
Component
SBO-GEN-PLD Print Layout Designer
Other Components
SBO-SH-PLD-A1 Print Layout Designer known Issues
Priority
Recommendations/additional info
Category
Consulting
References
This document refers to: SAP Business One Notes
993486
'Set as Default for All BPs' doesn't affect specific BP
This document is referenced by: SAP Business One Notes (1)
993486
'Set as Default for All BPs' doesn't affect specific BP
Validity
Software Component
Version
SAP BUSINESS ONE
2004 A
2005 A
2005 A SP01
2005 B
2007 A
2007 B
JM -
Cursor becomes invisible in JTextField after using default button
In my application there is an update screen (JPanel). I am using default button in that panel. The input field is a normal JTextField. When the update is over the cursor goes back to the input JTextField.
Now my problem is that when I carry out update with mouse, the cursor is correctly placed into the input JTextField and is visible after the update is over. On the other hand, if I carry out the same update operation using default button (using keyboard), the cursor gets placed correctly in the input JTextfield column, but becomes invisible. If I minimize and then again maximize the window, the cursor appears back. What am I missing ? Note that I am using component.requestFocusInWindow() to get focus back to the input JTextField.
regards,
nirvanWhile trying to reproduce the behaviour for SSCCE, I found that it is the JOptionPane.showMessageDialog() that is causing the problem. Here is the SSCCE.
package com.ns;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
public class TestFocus extends javax.swing.JFrame {
// Variables declaration - do not modify
private JTextField field1;
private JTextField field2;
private JPanel jPanel1;
private JButton reset;
private JButton update;
// End of variables declaration
public TestFocus() {
initComponents();
setDefaultButton();
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new JPanel();
field1 = new JTextField();
field2 = new JTextField();
update = new JButton();
reset = new JButton();
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
field1.setPreferredSize(new Dimension(40, 20));
jPanel1.add(field1);
field2.setPreferredSize(new Dimension(40, 20));
jPanel1.add(field2);
update.setText("Update");
update.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
updateActionPerformed(evt);
jPanel1.add(update);
reset.setText("Reset");
reset.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
resetActionPerformed(evt);
jPanel1.add(reset);
getContentPane().add(jPanel1, BorderLayout.CENTER);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-385)/2, (screenSize.height-258)/2, 385, 258);
}// </editor-fold>
public void setDefaultButton(){
this.getRootPane().setDefaultButton(update);
private void updateActionPerformed(ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(this,"Activity Updated Succesfully in Database.",
"Information",
JOptionPane.INFORMATION_MESSAGE);
update.setEnabled(false);
field1.setEditable(false);
reset.setEnabled(true);
this.getRootPane().setDefaultButton(reset);
private void resetActionPerformed(ActionEvent evt) {
// TODO add your handling code here:
field1.requestFocusInWindow();
field1.setText("");
field1.setEditable(true);
reset.setEnabled(false);
update.setEnabled(true);
this.getRootPane().setDefaultButton(update);
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TestFocus().setVisible(true);
}If I remove the JOptionPane.showMessageDialog() method, everything works fine with mouse as well as keyboard.
regards,
nirvan. -
The default button in JFileChooser
Is it possible to make either the 'save' or 'cancel' button the default button (the one that will be pressed when the user presses the 'enter' key after the dialog is shown) in a save-dialog ?
It will probably involve setting the focus to either one of these buttons, but it is unclear how I can do that.
Thanks in advance.public static JButton searchByText(Component comp, String[] texts) {
if (comp instanceof JButton) {
JButton btn = (JButton) comp;
String text = btn.getText();
for(int j=0; j<texts.length; ++j)
if (text.equals(texts[j]))
return btn;
return null;
if (comp instanceof Container) {
Container cont = (Container) comp;
for(int j=0, ub=cont.getComponentCount(); j<ub; ++j) {
JButton result = searchByText(cont.getComponent(j), texts);
if (result != null)
return result;
return null;
}You can call this method, passing it your JFileChooser and:
String[] approves = {"Open", "Save"}; -
Default button being clicked multiple times when enter key is pressed
Hello,
There seems to be a strange difference in how the default button behaves in JRE 1.4.X versus 1.3.X.
In 1.3.X, when the enter key was pressed, the default button would be "pressed down" when the key was pressed, but wouldn't be fully clicked until the enter key was released. This means that only one event would be fired, even if the enter key was held down for a long time.
In 1.4.X however, if the enter key is pressed and held for more than a second, then the default button is clicked multiple times until the enter key is released.
Consider the following code (which is just a dialog with a button on it):
public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
private JButton jButton1 = new JButton("button");
public SimpleDialog()
this.getContentPane().add(jButton1);
this.getRootPane().setDefaultButton(jButton1);
jButton1.addActionListener(this);
this.pack();
public void actionPerformed(ActionEvent e)
if (e.getSource() == jButton1)
System.out.println("button pressed");
public static void main(String[] args)
new SimpleDialog().show();
When you compile and run this code under 1.3.1, and hold the enter key down for 10 seconds, you will only see one print line statement.
However, if you compile and run this code under 1.4.1, and then hold the enter key down for 10 seconds, you will see about 100 print line statements.
Is this a bug in 1.4.X or was this desired functionality (e.g. was it fixing some other bug)?
Does anyone know how I can make it behave the "old way" (when the default button was only clicked once)?
Thanks in advance if you have any advice.
DaveHello all,
I think I have found a solution. The behaviour of the how the default button is triggered is contained withing the RootPaneUI. So, if I override the default RootPaneUI used by the UIDefaults with my own RootPaneUI, I can define that behaviour for myself.
Here is my simple dialog with a button and a textfield (when the focus is NOT on the button, and the enter key is pressed, I don't want the actionPerformed method to be called until the enter key is released):
package focustests;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
private JButton jButton1 = new JButton("button");
public SimpleDialog()
this.getContentPane().add(new JTextField("a text field"), BorderLayout.NORTH);
this.getContentPane().add(jButton1, BorderLayout.SOUTH);
this.getRootPane().setDefaultButton(jButton1);
jButton1.addActionListener(this);
this.pack();
public void actionPerformed(ActionEvent e)
if (e.getSource() == jButton1)
System.out.println("button pressed");
public static void main(String[] args)
javax.swing.UIManager.getDefaults().put("RootPaneUI", "focustests.MyRootPaneUI");
new SimpleDialog().show();
and the MyRootPaneUI class controls the behaviour for how the default button is handled:
package focustests;
import javax.swing.*;
* Since we are using the Windows look and feel in our product, we should extend from the
* Windows laf RootPaneUI
public class MyRootPaneUI extends com.sun.java.swing.plaf.windows.WindowsRootPaneUI
private final static MyRootPaneUI myRootPaneUI = new MyRootPaneUI();
public static javax.swing.plaf.ComponentUI createUI(JComponent c) {
return myRootPaneUI;
protected void installKeyboardActions(JRootPane root) {
super.installKeyboardActions(root);
InputMap km = SwingUtilities.getUIInputMap(root,
JComponent.WHEN_IN_FOCUSED_WINDOW);
if (km == null) {
km = new javax.swing.plaf.InputMapUIResource();
SwingUtilities.replaceUIInputMap(root,
JComponent.WHEN_IN_FOCUSED_WINDOW, km);
//when the Enter key is pressed (with no modifiers), trigger a "pressed" event
km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
0, false), "pressed");
//when the Enter key is released (with no modifiers), trigger a "release" event
km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
0, true), "released");
ActionMap am = SwingUtilities.getUIActionMap(root);
if (am == null) {
am = new javax.swing.plaf.ActionMapUIResource();
SwingUtilities.replaceUIActionMap(root, am);
am.put("press", new HoldDefaultButtonAction(root, true));
am.put("release", new HoldDefaultButtonAction(root, false));
* This is a copy of the static nested class DefaultAction which was
* contained in the JRootPane class in Java 1.3.1. Since we are
* using Java 1.4.1, and we don't like the way the new JRE handles
* the default button, we will replace it with the old (1.3.1) way of
* doing things.
static class HoldDefaultButtonAction extends AbstractAction {
JRootPane root;
boolean press;
HoldDefaultButtonAction(JRootPane root, boolean press) {
this.root = root;
this.press = press;
public void actionPerformed(java.awt.event.ActionEvent e) {
JButton owner = root.getDefaultButton();
if (owner != null && SwingUtilities.getRootPane(owner) == root) {
ButtonModel model = owner.getModel();
if (press) {
model.setArmed(true);
model.setPressed(true);
} else {
model.setPressed(false);
public boolean isEnabled() {
JButton owner = root.getDefaultButton();
return (owner != null && owner.getModel().isEnabled());
This seems to work. Does anyone have any comments on this solution?
Tjacobs, I still don't see how adding a key listeners or overriding the processKeyEvent method on my button would help. The button won't receive the key event unless the focus is on the button. There is no method "enableEvents(...)" in the AWTEventMulticaster. Perhaps you have some code examples? Thanks anyway for your help.
Dave -
i want to know about Default Button Handling.
Default Button means "Auto Focused Submit Button when i click page and press enter key ".
i want to know how can i set some submit button to Default Submit Button.
Message was edited by:
Redsky21
Message was edited by:
Redsky21The description is still quite not understandable. Please put it in more detail with a sample scenario if possible.
--Shiv -
Default Button: switched to last focussed, but want Windows behavior, how?
In a JDialog, if I add components and set one to be the default button, plus
use the Windows L&F, I expect the Windows L&F behavior, that is, as long
as I tab along buttons, an Enter will activate a button if it has focus, but if I
tab to another component, the desired default button should be visually marked (darker edge)
and an Enter should activate it.
In Plugin's JRE 1.3.1, this is not the case. The default button is reset to the last button that had
the keyboard focus.
In a JVM 1.2.2, the same code produced the expected result!
The bug db listed a few solutions, one of them was to use a Focus Manager to
track focus and then "manually" reset the default button each time the focus is not on a button.
Anyone out there with a more details on this solution?
Or perhaps, there is a better solution than tracking focus events manually?
SylviaFound a solution myself, which at least works for windows l&f:
make all buttons non-default capable (setDefaultCapable(false)), except for the one button, that is to be the default button. This has the unfortunate effect, that a non-default button, which has input focus, does not react to to ENTER, but the ENTER is sent to the default button instead.
So must add a keyboard action to handle the ENTER:
KeyStroke keyStroke = KeyStroke.getKeyStroke ("ENTER");
ActionListener action = new ActionListener(){
public void actionPerformed() {getMyButton().doClick();}};
getMyButton().registerKeyboardAction (action, keyStroke, WHEN_FOCUSED);
That did it for my case.
Sylvia -
Default Button in YES_NO-JOptionPane
Hello,
in a YES_NO-JOptionPane the default button is YES. I would like to have it on NO. I managed to do this via getComponent. However, I am asking myself whether it has to be that complicated. Did anybody achieve this in a simpler way, e.g. in using setInitialSelectionValue or setInitialValue?
Regards
J�rgHello Sai Pullabhotla,
thank you for your code. I felt there had to be something simpler . Unfortunately the code works only with metal PLAF. But this is not a shortcoming of the code, but rather a Java bug, I suppose. I am going to send a bug report.
Until the bug is fixed we could use the following code, which also allows to put the focus on the default button.
String plaf="...";
int defaultNOoptionPane(String message, String title)
{ // Displays a YES_NO optionPane with the No-button set as default.
JOptionPane oPane = new JOptionPane(message, JOptionPane.QUESTION_MESSAGE,
JOptionPane.YES_NO_OPTION);
int i=1;
if (plaf.equals("Motif")) i=2;
JButton noButton = (JButton)((JPanel)oPane.getComponent(i)).getComponent(1);
JDialog dialog = oPane.createDialog(this, title);
dialog.getRootPane().setDefaultButton(noButton);
noButton.requestFocus();
dialog.show();
Object selectedValue = oPane.getValue();
if (selectedValue==null) return -1;
return ((Integer)selectedValue).intValue();
}Greetings
J�rg -
I've done this before but can't remember how now. How can I make a JButton the "default" button in a JFrame, such that if I hit enter while keyboard focus is on any component in the frame (that doesn't intercept the Enter keystroke itself), it's the same as clicking the button with the mouse?
hi,
if you are working with keyboard you need to have a keytyped-method. So if the return-key is pressed just only work with this button.
example:// ...
JButton jb=new JButton("Press Return");
public void keyTyped(KeyEvent e){
if(e.getKeyCode()==// the variable for return)
// do whatever the button should do
}regards -
PopUp Dialog default button action
Hi All ,
I am Using the JDeveloper 11.1.2.0
in the pop up Dialog Yes No Cancle in this ADF Default Action Showing Yes only in my Senario need to No button .please Help me How to change the Default Button Action .
thanks ,
Ala .
Edited by: ARm on Aug 31, 2012 3:19 AMIn my way Dialog mesage Using the 'Yes' ,'No' ,'Cancle' in three button in ADF Default Focus setting the Yes Button only .But I need to Set the Default Focus Is 'No' button
Edited by: ARm on Aug 31, 2012 4:14 AM
Maybe you are looking for
-
Hi all, While doing Goods Receipt against an STO, the system shows the message: "MSSA-SATRA exceeded by 500 SET" I have done 351 movement to post the stock in stock in transit.The qty which is to be sent is correct. Please give some solution. Regards
-
OS X Maverick thinks I have an administrative password....
I am trying to download the free OS X Mavericks update but when it asks for my administrator password it does not allow me in. As I am the only one in my home that uses this MAC and I have not set a password so enter usually does the trick. Any sug
-
Create CIN in MSVC++ version 6.
detailed note on creating CIN in MSVC++ VERSION 6. tried the link in http://pong.ni.com/public.nsf/websearch/D7BDB30EEF410056862569AB00724294? but could not open........... pls help. regards sithara
-
Trying to install Leopard...
Hi there, I just bought a new macbook 13" so decided to give my older iMac G5 to my sister for christmas and at the same time to update it to Leopard. Since the iMac was unable to read from Leopard's double-layer dvd, I decided to try installing it f
-
Engineering change management working with parameter effectivity
In Engineering change management i have activated parameter effectivity & defined parameter profile for DATE,SERNR,Kombi1-Customer(combination of Date & Customer name- Kunnr) in IMG settings i am able to work with Date & SERNR But when i choose kombi