AbstractAction setting disabledIcon

Friends,
I have an AbstractAction in a toolbar and I want to disable it until something happens. I've done this correctly, but by default it grayFilter's the Icon until it is enabled. I attempted setDisabledIcon(icon); but AbstractAction doesn't support that.
In my code I'm using:public SlideShowAction(SlideViewFrame frame) { super("Slide Show", showIcon);  ... } to set up the AbstractAction with the icon.
Is there a way to set the disabled icon so it isn't grayFiltered when it's disabled?
Thanks for your time!

Bumping while still in the 10 most recent posts? You are on a tight deadline!
Ok, the input map has a condition associated with it for when it applies. By default it's used when the component is focused. You might just be after using the "when in focused window" condition. You can then grab the focus to your text area if you wish.
Try this:
     public static void main(String[] args) {
          KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0);
          JTextArea ta = new JTextArea();
          ta.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ks, "f3");
          ta.getActionMap().put("f3", new AbstractAction() {
               public void actionPerformed(ActionEvent e) {
                    System.err.println(e);
                    ((JTextArea)e.getSource()).requestFocus();
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.getContentPane().setLayout(new GridLayout(2, 1));
          frame.getContentPane().add(ta);
          frame.getContentPane().add(new JButton("Foo"));
          frame.pack();
          frame.show();
     }Hope this helps.

Similar Messages

  • Doubt about dispose() method of JDialog

    Hi guys,
    Consider the following code:
              MyDialog dialog = new MyDialog(parent);
              dialog.setVisible(true);
                    // may the dialog was disposed before the following line gets executed
              dialog.getVariableValue();
              dialog.dispose();Suppose the MyDialog extends JDialog and have a member variable which can be accessed by getVariableValue() method.
    A dialog appears, enter something which is stored by a member variable of the MyDialog class. Then close the dialog by invoking dispose() method. After the dialog disappears, the next line dialog.getVariableValue() can get the entered value.
    I thought that the dialog will be null after dispose() gets called, but actually not.
    Is the current thread stopped at the line dialog.setVisible(true) and wait for the dialog to be closed?
    Can anyone explain?

    depends if you are to check isDisplayable() after myContainer = nullbut my output would be still
    run:
    100
    LoopsNo1
    There is JFrame
    LoopsNo2
    There is JFrame
    LoopsNo3
    There is JFrame
    LoopsNo4
    There is JFrame
    System Exit
    100
    100
    100
    100
    100
    100
    BUILD SUCCESSFUL (total time: 13 seconds)from code
    import java.awt.Dialog;
    import java.awt.Frame;
    import java.awt.Window;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JWindow;
    import javax.swing.SwingUtilities;
    public class WindowGCDemo {
        private javax.swing.Timer timer = null;
        private int count = 0;
        public WindowGCDemo() {
            JFrame myFrame = new JFrame();
            for (int i = 0; i < 99; i++) {
                JWindow jWindow = new JWindow(myFrame);
                jWindow.setSize(200, 400);
                jWindow.setVisible(true);
                //jWindow = null;
            start();
            System.out.println(JWindow.getWindows().length); // prints 100
        private void start() {
            timer = new javax.swing.Timer(3000, updateCol());
            timer.start();
        private void startAgain() {
            timer = new javax.swing.Timer(3000, updateColAgain());
            timer.start();
        public Action updateCol() {
            return new AbstractAction("Set Delay") {
                private static final long serialVersionUID = 1L;
                @Override
                public void actionPerformed(ActionEvent e) {
                    timer.stop();
                    Window[] wins = Window.getWindows();
                    for (int i = 0; i < wins.length; i++) {
                        if (wins[i] instanceof JWindow) {
                            wins.setVisible(false);
    wins[i].dispose();
    wins[i] = null;
    System.gc();
    count++;
    startAgain();
    public Action updateColAgain() {
    return new AbstractAction("Set Delay") {
    private static final long serialVersionUID = 1L;
    @Override
    public void actionPerformed(ActionEvent e) {
    System.out.println("LoopsNo" + count);
    Window[] wins = Window.getWindows();
    for (int i = 0; i < wins.length; i++) {
    if (wins[i] instanceof JWindow) {
    } else if (wins[i] instanceof JFrame) {
    System.out.println("There is JFrame");
    } else if (wins[i] instanceof JDialog) {
    System.out.println("There is JFrame");
    } else if (wins[i] instanceof JWindow) {
    System.out.println("There is JWindow");
    wins[i].setVisible(true);
    } else {
    System.out.println("There is something else");
    count++;
    startAgain();
    if (count > 4) {
    timer.stop();
    stop();
    private void stop() {
    System.out.println("--------------------------------------------");
    System.out.println("System Exit");
    System.out.println(JFrame.getWindows().length);
    System.out.println(JDialog.getWindows().length);
    System.out.println(JWindow.getWindows().length);
    System.out.println(Frame.getWindows().length);
    System.out.println(Dialog.getWindows().length);
    System.out.println(Window.getWindows().length);
    System.exit(0);
    public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
    @Override
    public void run() {
    WindowGCDemo windowGCDemo = new WindowGCDemo();
    }Edited by: mKorbel on 18.9.2011 23:30 typos                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Wait cursors not set till end of AbstractAction.actionPerformed()

    Hi.
    Is there a problem setting the wait cursor in the actionPerformed method of Actions? I?m running Java 1.4.1_02.
    I am finding that if I try and set a wait cursor in AbstractAction.actionPerformed() it never gets displayed until the very end of the method, which is a bit useless because this is usually when I want to set it back to the default cursor. The result is that I never see the wait cursor when I execute the action.
    I don?t have the same problem with setting cursors in JComponent.actionPerformed().
    Does anyone have a solution?
    The following code fragment demonstrates the problem. It is from a class that extends the abstractAction class. It calls a method of my own to set the wait cursor ( on the root container and its child components ), then sleeps for a bit. The wait cursor is only shown after the sleep.
    public void actionPerformed( java.awt.event.ActionEvent oActionEvent )
    ESTrace.printMsg( ESTrace.LEVEL_3, "Start of ESAction_NEW.actionPerformed.");
    ESValues.m_oUtils.setGlobalCursor( new Cursor( Cursor.WAIT_CURSOR ) );
    ESTrace.printMsg( ESTrace.LEVEL_3, "ESAction_NEW.actionPerformed. Start Wait");
    try
    Thread oThread = Thread.currentThread();
    oThread.sleep(15000);
    catch(Exception e)
    System.out.println("Wait exception");
    e.printStackTrace();
    ESTrace.printMsg( ESTrace.LEVEL_3, "End of ESAction_NEW.actionPerformed");

    If you set the Field 'Comb' value to show a specific number of characters, then you can use this in the Custom Format script:
    if (event.target.comb) {
    var l = event.value.length
    var m = event.target.charLimit
    var x = m - l
    var s = ""
    if (event.value != "") {
    for (var i = 1; i < x; i++) { s = s + "." }
    event.value = event.value + s
    Note that this will space the characters out to fit the width of the field, and may not line up with other fields properly. Otherwise, without using a monospaced font, I don't know if there is a way for you to know how many periods are needed to fill out the field.

  • Problem AbstractAction - JButton.setRolloverIcon()

    Hi,
    Since i (and i don't understand why) couldn't really find anything in google, or in this forum search, i'm requesting you guys' help
    Here's a brief description of the problem:
    When just using a JButton (with some text on it), without any Actions assigned to it, it's no problem at all to assign a disabledIcon, rolloverIcon (setDisabledIcon, setRolloverIcon) to the button.
    BUT
    once you apply an action class to it (in my case i'm extending my action class from AbstractAction), things go wrong:
    - Apparently, you CAN pass on an Icon (the default icon on the image) to the action class, and then calling the super(String command, Icon icon) constructor.
    - But how to set a disabledIcon or rolloverIcon using this action class ? You can't pass this on the the super constructor like the default icon. I'm really not seeing what i 'm doing wrong here :-(
    Thanks in advance for your replies and help,
    Regards,
    Sander
    PS: i'm new to this forum, if i'm giving you guys to little information, please let me know.

    but using action isn't the best idea. The benefit of using an Action is that it can be shared by multiple components. A typical GUI design would have a menu item and a toolbar button to invoke the same action. The coding is easy:
    Action someAction = new SomeAction(...);
    JMenuItem someItem = new JMenuItem( someAction );
    JButton someButton = new JButton( someAction );
    If you ever need to disable the Action you would do:
    someAction.setEnable( false );
    and the menu item and toolbar button would both be updated.

  • Why AbstractAction sometimes work sometimes doesn't work ?

    In my program I need to use the Esc key, so I did the following to implement it, sometimes when I started the program and press the Esc key, it works as I intended, but other times after the program starts and I pressed the Esc key, no response, but if I minimize the window and restore it, and then I press the Esc key, it would work fine. Has anyone encountered similar problem ?
        Action Escape_Action=new AbstractAction("Escape Action")                             // Create an action object
          public static final long serialVersionUID=26362862L;
          // This is an instance initializer; it is executed just after the constructor of the superclass is invoked
            // The following values are completely optional
            // Set tool tip text
            putValue(Action.SHORT_DESCRIPTION,"Tool Tip Text");
            // This text is not directly used by any Swing component; however, this text could be used in a help system
            putValue(Action.LONG_DESCRIPTION,"Context-Sensitive Help Text");
            // Set an icon
            Icon icon = new ImageIcon("icon.gif");
            putValue(Action.SMALL_ICON, icon);
            // Set a mnemonic character. In most look and feels, this causes the specified character to be underlined. This indicates that if the
            // component using this action has the focus and In some look and feels, this causes the specified character in the label to be underlined
            putValue(Action.MNEMONIC_KEY,new Integer(java.awt.event.KeyEvent.VK_A));
            // Set an accelerator key; this value is used by menu items
            putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0));
          public void actionPerformed(ActionEvent evt)                                       //  This method is called when the action is invoked
        // Register keystroke
        this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),Escape_Action.getValue(Action.NAME));
        // Register action
        this.getActionMap().put(Escape_Action.getValue(Action.NAME),Escape_Action);
        Frank

    You need to create a "Short, Self Contained, Compilable
    and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't
    guess exactly what you are doing based on the information provided.

  • ActionListener/AbstractAction

    Hello everyone,
    Can someone tell me the best choice for action-event handling in swing?
    Extends AbstractAction or implements ActionListener
    Thanks for clarifying

    abstractAction implements actionListener so if you extend it then you are infact implementing actionListener...
    but AbstractAction has values like tooltip, text, icon, and others, and you can construct JButton or menus from AbsractAction,
    this is good when you lets say you have a JMenuItem that dose somthing and you want the same thing to be on a JToolBar then just add the same AbsractAction to bot the JMenuItem and JToolBar then you will not have multiple
    if(event.getSource()==button1)so i preffer the AbstractAction but i use it like this..
    //Menu -> Help -> About
          AbstractAction about=new AbstractAction(){
             public void actionPerformed(ActionEvent e){aboutAction();}
          Utils.setActionValues(about,"About",
                new ImageIcon("about.gif"),KeyEvent.VK_A,
                "Shows the about dialog",null,true);
    //the Utils method is like this
        * Sets the values of the input action
       public static void setActionValues (Action action, String name, Icon icon,
          int mnemonic, String description, KeyStroke accelerator,
          boolean enabled)
          action.putValue(Action.ACCELERATOR_KEY, accelerator);
          action.putValue (Action.MNEMONIC_KEY, new Integer (mnemonic));
          action.putValue (Action.NAME, name);
          action.putValue (Action.SHORT_DESCRIPTION, description);
          action.putValue (Action.SMALL_ICON , icon);
          action.setEnabled (enabled);
       }i would then use it like this
    JMenu menu=new JMenu();
    menu.add(about);
    JToolBar toolBar =new JToolBar();
    tooBar.add(about);hope this helps... you

  • Can someone explain how to set the focus to a component

    Hello,
    What is the best way to ensure that a component gets the focus with code. I have tried requestFocus and requestFocusInWindow and none of them seems to do there work. The frame containing the components that should get the focus is displayed, the component is focusable so that is not the problem. What I found out is that if the component is deep in a nesting of panes (where the top pane is in the frame) is that calling requestFocus or requestFocusInWindow does not give the component where this focus is called on the focus but either the pane that contains it, one of the parent panes of this pane or one of the components in these panes, in almost all cases the component requesting the focus does not get the focus at all. I always have to write a work around in defining a focus listener for all these panes that transfer the focus back to the component that requested the focus originally, I can't believe that this is the way to ensure that a component has the focus via code. I have searched for documentation but found nothing on what requestFocus(inWindow) is actually dooing (a lot about focus traversibility but I don't want to control this, just make sure that a component gets the focus).
    Again I'm pretty sure that the toplevel window is activated and that the component that requested the focus is focusable (I had created a derived version of the DefaultFocusManager that showed who has focus). Personally I think (and I'm not alone if you do a search in this forum on focus management) that there is either a big problem in the documentation of focus management or that it is still not possible to even try to set the focus on a component in a easy way.
    Marc

    Hello,
    thanks for your reply, here is some example code that illustrates the problem I have (the actual code is to big to show here, which is the raison why I did not posted it here). The code wil create a frame with a JPanel with a JTextField, a 'New' Jbutton and a 'Delete' Jbutton, a tabbed pane in the center ('New' will create a new JPanel, add it to the tabbed pane and set the focus on it, either by calling RequestFocusInWindow() directly or by calling it via InvokeLater (someone on this forum suggested to use this). I changed also the focusmanager to show the component that has the focus when you type something. To test compile and run the program (either with a call to requesteFocusInWindow directly or indirectly (by changing the comments), on my system I get the following behaviour:
    1. requestFocusInWindow called directly
    Start program en type, the tabbed pane has the focus
    Press New and type something, a button has the focus not the created panel
    Press New again and type something, a button has the focus not the created panel
    2. requestFocusInWindow be called indirectly
    Start program and type, the tabbed pane has the focus
    Press New and type, the created panel has the focus (I thought at one moment that I had found the solution there, but alas ...)
    Press New again and type something, a button has again the focus.
    Note that with my real program it is not always a button that will have the focus, sometimes it is a combobox or a TextField (I tried to get this with the example code (the JTextField) but did not succeed.
    Hopes this clarify the problem a little bid, what I want is when the window is visible to set focus on newly created panes (or in the real program on the panel that is selected via the tabbed pane or via a key combination to shift the focus between the panels) but requestFocusInWindow seems to behave unpredicatable. I can't imagine that what I see is a bug so I must make some assumptions which are not valid but I don't see them, btw listening on the WindowListener is I think not the solution because the frame is already displayed when I want to set the focus and I do not use a modal dialog box.
    The example code follows here
    Marc
    * Main.java
    * Created on December 21, 2004, 8:58 AM
    package testfocus;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    * @author marc
    public class Main
    static int counter;
    /** Creates a new instance of Main */
    public Main()
    * @param args the command line arguments
    public static void main(String[] args)
    JFrame frm=new JFrame();
    JPanel content=new JPanel();
    frm.setContentPane(content);
    final JTabbedPane paneContainer=new JTabbedPane();
    JPanel bar=new JPanel();
    JButton create=new JButton(new AbstractAction("New")
    public void actionPerformed(ActionEvent ev)
    counter++;
    final JPanel pnl=new JPanel();
    pnl.setName("test"+counter);
    paneContainer.add(pnl);
    pnl.setFocusable(true);
    pnl.requestFocusInWindow();
    /* Either use this or the previous line
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    pnl.requestFocusInWindow();
    JButton delete=new JButton(new AbstractAction("Delete")
    public void actionPerformed(ActionEvent ev)
    int i=paneContainer.getComponentCount()-1;
    if (i>=0)
    paneContainer.remove(i);
    JTextField dummy=new JTextField("Test");
    bar.add(dummy);
    bar.add(create);
    bar.add(delete);
    content.setLayout(new BorderLayout());
    content.add(bar,BorderLayout.SOUTH);
    content.add(paneContainer,BorderLayout.CENTER);
    frm.setSize(300,400);
    FocusManager.setCurrentManager(new DefaultFocusManager()
    public void processKeyEvent(Component component,KeyEvent ev)
    System.out.println("Focus owner"+getFocusOwner());
    super.processKeyEvent(component,ev);
    frm.setVisible(true);
    }

  • Setting up dynamic actions

    Hullo there,
    I'm still on my way with my Monopoly game.
    Now, I have a center panel displaying the squares 'properties' when a player lands on it. For example, when he lands on a Station, the center panel has a list with the price, the owner (if owned), etc. This is done via a SquareListener.
    So far, so good. BUT, I'd like now to give the player options in a popup menu.
    For example, if the square is owned by himself, he can't buy it, but can sell it or built it. On the other hand, he may buy each square which isn't already oned by somebody...
    This is where I'm stuck. My square listener isn't enough here. I'll have a lot of testing and checking to do for each square. So I thought there might be another solution for this.Maybe a list of actions. But what of type would be these ? Moreover, the actions cannot belong to the square, since they will be different for each player (see above).
    What am I to do there ?
    Sorry if it's a bit confuse, I'm confused and quite lost here, to say the truth.

    1) Is it the correct way to do it or should I create a
    separate Actions class ?Why are you re-creating the actions all the time?
    I would write it as:
    public class Square {
        Action buy;
        Action build;
        Action[] allActions;
        //Add some more attributes
        public Square()  {
            buyAction = new BuyAction();
            build = new BuildAction();
            allActions = new Action[] { buy, build };
        public Action[] getAction(Player player) {  //The method could return a JMenu
            for (int i=0; i<allActions.length; i++) {
                allActions.setEnabled(true);
    if (player.equals(owner)) {
    buy.setEnabled(false);
    return allActions;
    class BuyAction extends AbstractAction {
    //Add some code here
    //Add code for the other inner classes
    You could either write the actions as innerclasses, or as separate classes, and write a callback interface. Depends on your situation.
    2) I read somewhere some time ago (don't remember
    where nor when) that custom actions where memory
    consuming and one should prefer actionListeners. Is
    this true ? You don't have to bother about that in your case (just try to change your implementation so that you aren't re-creating all actions all the time. Actions is what you should normally use, since an action can be re-used. I.e. you can add/set the same action to a button and menu item etc. And when you disable the action, all buttons and menu items that has it will be disabled.
    /Kaj

  • JFileChooser set focus to specific directory

    Is it possible to set the JFileChooser to grab focus on the previous selected directory in directory only mode from the textfield containing the selected file name?
    The behavior I am seeking is to show the chooser with a directory already selected and or highlighted. I have tried the set selected file method and that does not highlight the file as if the user selected the file. I keep getting various behaviors where I set the selected folder. In the file name text component it shows upper level directories at times instead of the directory I specified. The focus is typically located on the file name text component and I would rather have the focus on the directory entry specified in the file name text. Is that possible with JFileChooser?

    Hello,
    I've tried to work something out. I hope it doesn't seem overkill :import javax.swing.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.WindowFocusListener;
    import java.awt.event.WindowEvent;
    import java.awt.*;
    import java.io.File;
    * Date: 9 mai 2008
    * @author: Pierre Le Lannic
    public class FileChooserTest {
         private File _dir;
         private JLabel _fileNameLabel;
         private JPanel _mainPanel;
         private JList _filePane;
         private JFileChooser _fileChooser;
         public FileChooserTest() {
              _mainPanel = new JPanel(new BorderLayout());
              _fileNameLabel = new JLabel();
              _fileNameLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
              _mainPanel.add(_fileNameLabel, BorderLayout.CENTER);
              _mainPanel.add(new JButton(new AbstractAction() {
                   public void actionPerformed(ActionEvent e) {
                        prepareFileChooser();
                        _fileChooser.setSelectedFile(_dir);
                        int returnOption = _fileChooser.showSaveDialog(_mainPanel);
                        if (returnOption == JFileChooser.APPROVE_OPTION) {
                             setDir(_fileChooser.getSelectedFile());
              }), BorderLayout.EAST);
              setDir(new File(System.getProperty("user.home")));
         private void setDir(File aDirectory) {
              _dir = aDirectory;
              _fileNameLabel.setText(_dir == null ? " " : _dir.getAbsolutePath());
         private void prepareFileChooser() {
              if (_fileChooser == null) {
                   _fileChooser = new JFileChooser() {
                        protected JDialog createDialog(Component parent) throws HeadlessException {
                             JDialog dialog = super.createDialog(parent);
                             dialog.addWindowFocusListener(new WindowFocusListener() {
                                  public void windowGainedFocus(WindowEvent e) {
                                       requestFocusForList();
                                  public void windowLostFocus(WindowEvent e) {}
                             return dialog;
                   _fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                   _filePane = recursiveFindList(_fileChooser);
         private void requestFocusForList() {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        _filePane.requestFocus();
         private JList recursiveFindList(Container parent) {
              if (parent == null) return null;
              int n = parent.getComponentCount();
              for (int i = 0; i < n; i++) {
                   Component child = parent.getComponent(i);
                   if (child instanceof JList) return (JList)child;
                   if (child instanceof Container) {
                        JList test = recursiveFindList((Container)child);
                        if (test != null) return test;
              return null;
         public void start() {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        JFrame f = new JFrame();
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        f.setContentPane(_mainPanel);
                        f.setSize(400, 50);
                        f.setLocationRelativeTo(null);
                        f.setVisible(true);
         public static void main(String[] args) {
              new FileChooserTest().start();
    }

  • AbstractAction Question

    class OpenAction extends AbstractAction {
    OpenAction() {
    super("Open",openIcon);
    putValue(Action.MNEMONIC_KEY, "O");
    putValue(Action.SHORT_DESCRIPTION, "Open Alt-O");
    public void actionPerformed(ActionEvent actionEvent) {
         System.out.println("open");
    I was trying to use putValue(Action.MNEMONIC_KEY, "O"); to set Alt-O and
    a mnemonic for the icon called openIcon. However, I got a runtime error by using
    this line. Any one can help me with that? Thank you

    putValue( Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_O) );

  • Setting the Down Arrow Key. Help Needed.

    Folks
    I am having a problem.
    I have a custom cell renderer which displays a list.
    I am setting the focus of this list to the 1st element.
    Now,when I press the down Arrow key,this doesnt seem to
    go down nor the focus is coming downwards.
    Have I overlooked anything? Can someone please help?
    class MyListCellRenderer extends JPanel implements ListCellRenderer{
       private JLabel indexLabel;
       private JLabel imageAndText;      
       public MyListCellRenderer(){
       indexLabel = new JLabel();
       imageAndText = new JLabel();
       setLayout(new FlowLayout(FlowLayout.LEFT,3,0));
       add(indexLabel);
       add(imageAndText);
       setOpaque(true);
    public Component getListCellRendererComponent(
           JList list, Object value,int index,
           boolean isSelected, boolean cellHasFocus) {
    // ** Get the Focus on the first Element.
    list.setSelectedIndex(0);
    list.grabFocus();
    setBackground(isSelected ? Color.red : Color.blue);
    final JList fJList = list;
    // ** Now press the Down Arrow
    final Action downAction = actionMap.get("selectNextRow");
         actionMap.put("selectNextRow", new AbstractAction() {
         public void actionPerformed(ActionEvent e) {
          if (fJList.getSelectedIndex() < fJList.getModel().getSize() - 1)
            downAction.actionPerformed(e);
         else{
            fJList.setSelectedIndex(0);
            fJList.ensureIndexIsVisible(0);

    see
    http://www.replacementlaptopkeys.com/macbook-key.html
    or similar  ebay etc
    Be a bit wary of Glue for obvious reasons

  • Setting default cancel opperations on buttons

    Hi all.
    Does anyone know how to set a JButton to the default cancel button???
    In other words, no matter what field or button has the focus, if you push the 'esc' key, the 'default cancel' button activates.
    I am hoping it doesn't have to be a listener...
    Anyone know of a method???
    Thanks

    Try this:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame implements ActionListener {
        private JCheckBox coolnessBox;
        private JButton cancelButton;
        private JButton okayButton;
        public Test () {
            coolnessBox = new JCheckBox ("This example is cool");
            cancelButton = new JButton ("Cancel");
            cancelButton.addActionListener (this);
            okayButton = new JButton ("Okay");
            okayButton.addActionListener (this);
            JPanel boxPanel = new JPanel (new GridBagLayout ());
            boxPanel.add (coolnessBox, new GridBagConstraints ());
            boxPanel.setPreferredSize (new Dimension (300, 150));
            JPanel buttonPanel = new JPanel ();
            buttonPanel.setLayout (new BoxLayout (buttonPanel, BoxLayout.X_AXIS));
            buttonPanel.add (Box.createHorizontalGlue ());
            buttonPanel.add (cancelButton);
            buttonPanel.add (okayButton);
            getContentPane ().setLayout (new BorderLayout ());
            getContentPane ().add (boxPanel);
            getContentPane ().add (buttonPanel, BorderLayout.SOUTH);
            String cancelKey = "cancel";
            getRootPane ().getInputMap (JComponent.WHEN_IN_FOCUSED_WINDOW).put (KeyStroke.getKeyStroke (KeyEvent.VK_ESCAPE, 0), cancelKey);
            getRootPane ().getActionMap ().put (cancelKey, new AbstractAction () {
                public void actionPerformed (ActionEvent event) {
                    cancelButton.doClick ();
            setDefaultCloseOperation (EXIT_ON_CLOSE);
            setTitle ("Example - press ESC to quit");
            pack ();
            setLocationRelativeTo (null);
            show ();
        public void actionPerformed (ActionEvent event) {
            if (event.getSource () == okayButton) {
                System.out.println ("This example is " + (coolnessBox.isSelected () ? "" : "not ") + "cool");
            System.exit (0);
        public static void main (String[] parameters) {
            new Test ();
    }Kind regards,
      Levi

  • Xorg 1.10.1 no longer affected by manual DPI setting

    I use my 23 inch 1920x1080 monitor as TV also. As this means I sit rather far from it, I manually set DPI quite low to enlarge windows and fonts by default. However after the last upgrade, which brought Xorg 1.10 and Gnome 3, Xorg seems to no longer be affected by my setting DPI in xorg.conf. The logs show that the value is read, and xdpyinfo shows the DPI I have set manually, but this setting no longer seems to affect any windows or fonts.
    The DPI is set via the nvidia driver. Relevant parts of xorg.conf and the full Xorg.0.log are attached.
    Does anyone know what could have caused this?
    xorg.conf:
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    Option "DPI" "60x60"
    EndSection
    Xorg.0.log:
    [ 45267.074]
    X.Org X Server 1.10.1
    Release Date: 2011-04-15
    [ 45267.074] X Protocol Version 11, Revision 0
    [ 45267.074] Build Operating System: Linux 2.6.38-ARCH x86_64
    [ 45267.074] Current Operating System: Linux norstaurar 2.6.38-ARCH #1 SMP PREEMPT Fri May 13 09:24:47 CEST 2011 x86_64
    [ 45267.074] Kernel command line: root=/dev/disk/by-uuid/41bd750d-271b-4392-898a-51e284889d43 ro
    [ 45267.074] Build Date: 16 April 2011 12:02:01PM
    [ 45267.074]
    [ 45267.074] Current version of pixman: 0.20.2
    [ 45267.074] Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    [ 45267.074] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [ 45267.074] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Jun 3 10:40:17 2011
    [ 45267.074] (==) Using config file: "/etc/X11/xorg.conf"
    [ 45267.074] (==) Using config directory: "/etc/X11/xorg.conf.d"
    [ 45267.075] (==) ServerLayout "Layout0"
    [ 45267.075] (**) |-->Screen "Screen0" (0)
    [ 45267.075] (**) | |-->Monitor "Monitor0"
    [ 45267.075] (**) | |-->Device "Device0"
    [ 45267.075] (**) |-->Input Device "Keyboard0"
    [ 45267.075] (**) |-->Input Device "Mouse0"
    [ 45267.075] (==) Automatically adding devices
    [ 45267.075] (==) Automatically enabling devices
    [ 45267.075] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
    [ 45267.075] Entry deleted from font path.
    [ 45267.075] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
    [ 45267.075] Entry deleted from font path.
    [ 45267.075] (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
    [ 45267.075] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
    [ 45267.075] Entry deleted from font path.
    [ 45267.075] (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
    [ 45267.075] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/TTF/,
    /usr/share/fonts/Type1/
    [ 45267.075] (==) ModulePath set to "/usr/lib/xorg/modules"
    [ 45267.075] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    [ 45267.075] (WW) Disabling Keyboard0
    [ 45267.075] (WW) Disabling Mouse0
    [ 45267.075] (II) Loader magic: 0x7d6fa0
    [ 45267.075] (II) Module ABI versions:
    [ 45267.075] X.Org ANSI C Emulation: 0.4
    [ 45267.075] X.Org Video Driver: 10.0
    [ 45267.075] X.Org XInput driver : 12.2
    [ 45267.075] X.Org Server Extension : 5.0
    [ 45267.076] (--) PCI:*(0:2:0:0) 10de:0848:1043:82f2 rev 162, Mem @ 0xfd000000/16777216, 0xf0000000/134217728, 0xfa000000/33554432, I/O @ 0x0000ec00/128, BIOS @ 0x????????/131072
    [ 45267.076] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    [ 45267.076] (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.
    [ 45267.076] (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
    [ 45267.076] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
    [ 45267.076] (II) "record" will be loaded by default.
    [ 45267.076] (II) "dri" will be loaded by default.
    [ 45267.076] (II) "dri2" will be loaded by default.
    [ 45267.076] (II) LoadModule: "dbe"
    [ 45267.077] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    [ 45267.077] (II) Module dbe: vendor="X.Org Foundation"
    [ 45267.077] compiled for 1.10.1, module version = 1.0.0
    [ 45267.077] Module class: X.Org Server Extension
    [ 45267.077] ABI class: X.Org Server Extension, version 5.0
    [ 45267.077] (II) Loading extension DOUBLE-BUFFER
    [ 45267.077] (II) LoadModule: "extmod"
    [ 45267.077] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    [ 45267.077] (II) Module extmod: vendor="X.Org Foundation"
    [ 45267.077] compiled for 1.10.1, module version = 1.0.0
    [ 45267.077] Module class: X.Org Server Extension
    [ 45267.077] ABI class: X.Org Server Extension, version 5.0
    [ 45267.077] (II) Loading extension MIT-SCREEN-SAVER
    [ 45267.077] (II) Loading extension XFree86-VidModeExtension
    [ 45267.077] (II) Loading extension XFree86-DGA
    [ 45267.077] (II) Loading extension DPMS
    [ 45267.077] (II) Loading extension XVideo
    [ 45267.077] (II) Loading extension XVideo-MotionCompensation
    [ 45267.077] (II) Loading extension X-Resource
    [ 45267.077] (II) LoadModule: "glx"
    [ 45267.077] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    [ 45267.092] (II) Module glx: vendor="NVIDIA Corporation"
    [ 45267.092] compiled for 4.0.2, module version = 1.0.0
    [ 45267.092] Module class: X.Org Server Extension
    [ 45267.092] (II) NVIDIA GLX Module 270.41.19 Mon May 16 23:48:30 PDT 2011
    [ 45267.092] (II) Loading extension GLX
    [ 45267.092] (II) LoadModule: "record"
    [ 45267.092] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    [ 45267.092] (II) Module record: vendor="X.Org Foundation"
    [ 45267.092] compiled for 1.10.1, module version = 1.13.0
    [ 45267.092] Module class: X.Org Server Extension
    [ 45267.092] ABI class: X.Org Server Extension, version 5.0
    [ 45267.092] (II) Loading extension RECORD
    [ 45267.092] (II) LoadModule: "dri"
    [ 45267.092] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    [ 45267.092] (II) Module dri: vendor="X.Org Foundation"
    [ 45267.092] compiled for 1.10.1, module version = 1.0.0
    [ 45267.092] ABI class: X.Org Server Extension, version 5.0
    [ 45267.092] (II) Loading extension XFree86-DRI
    [ 45267.092] (II) LoadModule: "dri2"
    [ 45267.092] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 45267.092] (II) Module dri2: vendor="X.Org Foundation"
    [ 45267.092] compiled for 1.10.1, module version = 1.2.0
    [ 45267.092] ABI class: X.Org Server Extension, version 5.0
    [ 45267.093] (II) Loading extension DRI2
    [ 45267.093] (II) LoadModule: "nvidia"
    [ 45267.093] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 45267.093] (II) Module nvidia: vendor="NVIDIA Corporation"
    [ 45267.093] compiled for 4.0.2, module version = 1.0.0
    [ 45267.093] Module class: X.Org Video Driver
    [ 45267.094] (II) NVIDIA dlloader X Driver 270.41.19 Mon May 16 23:33:35 PDT 2011
    [ 45267.094] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    [ 45267.094] (++) using VT number 8
    [ 45267.096] (II) Loading sub module "fb"
    [ 45267.096] (II) LoadModule: "fb"
    [ 45267.096] (II) Loading /usr/lib/xorg/modules/libfb.so
    [ 45267.097] (II) Module fb: vendor="X.Org Foundation"
    [ 45267.097] compiled for 1.10.1, module version = 1.0.0
    [ 45267.097] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 45267.097] (II) Loading sub module "wfb"
    [ 45267.097] (II) LoadModule: "wfb"
    [ 45267.097] (II) Loading /usr/lib/xorg/modules/libwfb.so
    [ 45267.097] (II) Module wfb: vendor="X.Org Foundation"
    [ 45267.097] compiled for 1.10.1, module version = 1.0.0
    [ 45267.097] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 45267.097] (II) Loading sub module "ramdac"
    [ 45267.097] (II) LoadModule: "ramdac"
    [ 45267.097] (II) Module "ramdac" already built-in
    [ 45267.097] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 45267.097] (II) Loading /usr/lib/xorg/modules/libwfb.so
    [ 45267.097] (II) Loading /usr/lib/xorg/modules/libfb.so
    [ 45267.097] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    [ 45267.097] (==) NVIDIA(0): RGB weight 888
    [ 45267.097] (==) NVIDIA(0): Default visual is TrueColor
    [ 45267.097] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    [ 45267.097] (**) NVIDIA(0): Option "DPI" "60x60"
    [ 45267.369] (II) NVIDIA(GPU-0): Display (Samsung SyncMaster (DFP-0)) does not support NVIDIA
    [ 45267.369] (II) NVIDIA(GPU-0): 3D Vision stereo.
    [ 45267.370] (II) NVIDIA(0): NVIDIA GPU GeForce 8300 (C77) at PCI:2:0:0 (GPU-0)
    [ 45267.370] (--) NVIDIA(0): Memory: 524288 kBytes
    [ 45267.370] (--) NVIDIA(0): VideoBIOS: 62.77.2f.00.00
    [ 45267.370] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
    [ 45267.370] (--) NVIDIA(0): Connected display device(s) on GeForce 8300 at PCI:2:0:0
    [ 45267.370] (--) NVIDIA(0): Samsung SyncMaster (DFP-0)
    [ 45267.370] (--) NVIDIA(0): Samsung SyncMaster (DFP-0): 165.0 MHz maximum pixel clock
    [ 45267.370] (--) NVIDIA(0): Samsung SyncMaster (DFP-0): Internal Single Link TMDS
    [ 45267.372] (WW) NVIDIA(0): The EDID for Samsung SyncMaster (DFP-0) contradicts itself:
    [ 45267.372] (WW) NVIDIA(0): mode "720x480" is specified in the EDID; however, the
    [ 45267.372] (WW) NVIDIA(0): EDID's valid HorizSync range (27.000-81.000 kHz) would
    [ 45267.372] (WW) NVIDIA(0): exclude this mode's HorizSync (15.7 kHz); ignoring
    [ 45267.372] (WW) NVIDIA(0): HorizSync check for mode "720x480".
    [ 45267.372] (WW) NVIDIA(0): The EDID for Samsung SyncMaster (DFP-0) contradicts itself:
    [ 45267.372] (WW) NVIDIA(0): mode "720x576" is specified in the EDID; however, the
    [ 45267.372] (WW) NVIDIA(0): EDID's valid HorizSync range (27.000-81.000 kHz) would
    [ 45267.372] (WW) NVIDIA(0): exclude this mode's HorizSync (15.6 kHz); ignoring
    [ 45267.372] (WW) NVIDIA(0): HorizSync check for mode "720x576".
    [ 45267.375] (WW) NVIDIA(0): The EDID for Samsung SyncMaster (DFP-0) contradicts itself:
    [ 45267.375] (WW) NVIDIA(0): mode "720x480" is specified in the EDID; however, the
    [ 45267.375] (WW) NVIDIA(0): EDID's valid HorizSync range (27.000-81.000 kHz) would
    [ 45267.375] (WW) NVIDIA(0): exclude this mode's HorizSync (15.7 kHz); ignoring
    [ 45267.375] (WW) NVIDIA(0): HorizSync check for mode "720x480".
    [ 45267.376] (WW) NVIDIA(0): The EDID for Samsung SyncMaster (DFP-0) contradicts itself:
    [ 45267.376] (WW) NVIDIA(0): mode "720x576" is specified in the EDID; however, the
    [ 45267.376] (WW) NVIDIA(0): EDID's valid HorizSync range (27.000-81.000 kHz) would
    [ 45267.376] (WW) NVIDIA(0): exclude this mode's HorizSync (15.6 kHz); ignoring
    [ 45267.376] (WW) NVIDIA(0): HorizSync check for mode "720x576".
    [ 45267.402] (II) NVIDIA(0): Assigned Display Device: DFP-0
    [ 45267.402] (==) NVIDIA(0):
    [ 45267.402] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
    [ 45267.402] (==) NVIDIA(0): will be used as the requested mode.
    [ 45267.402] (==) NVIDIA(0):
    [ 45267.402] (II) NVIDIA(0): Validated modes:
    [ 45267.402] (II) NVIDIA(0): "nvidia-auto-select"
    [ 45267.402] (II) NVIDIA(0): Virtual screen size determined to be 1920 x 1080
    [ 45267.426] (**) NVIDIA(0): DPI set to (60, 60); computed from "DPI" X config option
    [ 45267.426] (--) Depth 24 pixmap format is 32 bpp
    [ 45267.426] (II) NVIDIA: Using 768.00 MB of virtual memory for indirect memory access.
    [ 45267.430] (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
    [ 45267.430] (II) NVIDIA(0): may not be running or the "AcpidSocketPath" X
    [ 45267.430] (II) NVIDIA(0): configuration option may not be set correctly. When the
    [ 45267.430] (II) NVIDIA(0): ACPI event daemon is available, the NVIDIA X driver will
    [ 45267.430] (II) NVIDIA(0): try to use it to receive ACPI event notifications. For
    [ 45267.430] (II) NVIDIA(0): details, please see the "ConnectToAcpid" and
    [ 45267.430] (II) NVIDIA(0): "AcpidSocketPath" X configuration options in Appendix B: X
    [ 45267.430] (II) NVIDIA(0): Config Options in the README.
    [ 45267.431] (II) NVIDIA(0): Setting mode "nvidia-auto-select"
    [ 45267.472] (II) Loading extension NV-GLX
    [ 45267.508] (==) NVIDIA(0): Disabling shared memory pixmaps
    [ 45267.508] (==) NVIDIA(0): Backing store disabled
    [ 45267.508] (==) NVIDIA(0): Silken mouse enabled
    [ 45267.509] (**) NVIDIA(0): DPMS enabled
    [ 45267.509] (II) Loading extension NV-CONTROL
    [ 45267.510] (II) Loading extension XINERAMA
    [ 45267.510] (II) Loading sub module "dri2"
    [ 45267.510] (II) LoadModule: "dri2"
    [ 45267.510] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 45267.510] (II) Module dri2: vendor="X.Org Foundation"
    [ 45267.510] compiled for 1.10.1, module version = 1.2.0
    [ 45267.510] ABI class: X.Org Server Extension, version 5.0
    [ 45267.510] (II) NVIDIA(0): [DRI2] Setup complete
    [ 45267.510] (==) RandR enabled
    [ 45267.510] (II) Initializing built-in extension Generic Event Extension
    [ 45267.510] (II) Initializing built-in extension SHAPE
    [ 45267.510] (II) Initializing built-in extension MIT-SHM
    [ 45267.510] (II) Initializing built-in extension XInputExtension
    [ 45267.510] (II) Initializing built-in extension XTEST
    [ 45267.510] (II) Initializing built-in extension BIG-REQUESTS
    [ 45267.510] (II) Initializing built-in extension SYNC
    [ 45267.510] (II) Initializing built-in extension XKEYBOARD
    [ 45267.510] (II) Initializing built-in extension XC-MISC
    [ 45267.510] (II) Initializing built-in extension SECURITY
    [ 45267.510] (II) Initializing built-in extension XINERAMA
    [ 45267.510] (II) Initializing built-in extension XFIXES
    [ 45267.510] (II) Initializing built-in extension RENDER
    [ 45267.510] (II) Initializing built-in extension RANDR
    [ 45267.510] (II) Initializing built-in extension COMPOSITE
    [ 45267.510] (II) Initializing built-in extension DAMAGE
    [ 45267.512] (II) Initializing extension GLX
    [ 45267.586] (II) config/udev: Adding input device Power Button (/dev/input/event3)
    [ 45267.586] (**) Power Button: Applying InputClass "evdev keyboard catchall"
    [ 45267.586] (II) LoadModule: "evdev"
    [ 45267.586] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 45267.586] (II) Module evdev: vendor="X.Org Foundation"
    [ 45267.586] compiled for 1.10.0, module version = 2.6.0
    [ 45267.586] Module class: X.Org XInput Driver
    [ 45267.586] ABI class: X.Org XInput driver, version 12.2
    [ 45267.586] (II) Using input driver 'evdev' for 'Power Button'
    [ 45267.586] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 45267.586] (**) Power Button: always reports core events
    [ 45267.586] (**) Power Button: Device: "/dev/input/event3"
    [ 45267.605] (--) Power Button: Found keys
    [ 45267.605] (II) Power Button: Configuring as keyboard
    [ 45267.605] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input3/event3"
    [ 45267.605] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    [ 45267.605] (**) Option "xkb_rules" "evdev"
    [ 45267.605] (**) Option "xkb_model" "evdev"
    [ 45267.605] (**) Option "xkb_layout" "se"
    [ 45267.636] (II) config/udev: Adding input device Video Bus (/dev/input/event1)
    [ 45267.636] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
    [ 45267.636] (II) Using input driver 'evdev' for 'Video Bus'
    [ 45267.636] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 45267.636] (**) Video Bus: always reports core events
    [ 45267.636] (**) Video Bus: Device: "/dev/input/event1"
    [ 45267.648] (--) Video Bus: Found keys
    [ 45267.648] (II) Video Bus: Configuring as keyboard
    [ 45267.648] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0A03:00/device:12/LNXVIDEO:00/input/input1/event1"
    [ 45267.648] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD)
    [ 45267.648] (**) Option "xkb_rules" "evdev"
    [ 45267.648] (**) Option "xkb_model" "evdev"
    [ 45267.648] (**) Option "xkb_layout" "se"
    [ 45267.650] (II) config/udev: Adding input device Power Button (/dev/input/event2)
    [ 45267.650] (**) Power Button: Applying InputClass "evdev keyboard catchall"
    [ 45267.650] (II) Using input driver 'evdev' for 'Power Button'
    [ 45267.650] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 45267.650] (**) Power Button: always reports core events
    [ 45267.650] (**) Power Button: Device: "/dev/input/event2"
    [ 45267.662] (--) Power Button: Found keys
    [ 45267.662] (II) Power Button: Configuring as keyboard
    [ 45267.662] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2/event2"
    [ 45267.662] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    [ 45267.662] (**) Option "xkb_rules" "evdev"
    [ 45267.662] (**) Option "xkb_model" "evdev"
    [ 45267.662] (**) Option "xkb_layout" "se"
    [ 45267.666] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event5)
    [ 45267.666] (**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
    [ 45267.666] (II) Using input driver 'evdev' for 'Logitech USB Receiver'
    [ 45267.666] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 45267.666] (**) Logitech USB Receiver: always reports core events
    [ 45267.666] (**) Logitech USB Receiver: Device: "/dev/input/event5"
    [ 45267.675] (--) Logitech USB Receiver: Found keys
    [ 45267.675] (II) Logitech USB Receiver: Configuring as keyboard
    [ 45267.675] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:04.0/usb4/4-3/4-3:1.0/input/input5/event5"
    [ 45267.675] (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: KEYBOARD)
    [ 45267.675] (**) Option "xkb_rules" "evdev"
    [ 45267.675] (**) Option "xkb_model" "evdev"
    [ 45267.675] (**) Option "xkb_layout" "se"
    [ 45267.676] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event6)
    [ 45267.676] (**) Logitech USB Receiver: Applying InputClass "evdev pointer catchall"
    [ 45267.676] (**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
    [ 45267.676] (II) Using input driver 'evdev' for 'Logitech USB Receiver'
    [ 45267.676] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 45267.676] (**) Logitech USB Receiver: always reports core events
    [ 45267.676] (**) Logitech USB Receiver: Device: "/dev/input/event6"
    [ 45267.685] (--) Logitech USB Receiver: Found 12 mouse buttons
    [ 45267.685] (--) Logitech USB Receiver: Found scroll wheel(s)
    [ 45267.685] (--) Logitech USB Receiver: Found relative axes
    [ 45267.685] (--) Logitech USB Receiver: Found x and y relative axes
    [ 45267.685] (--) Logitech USB Receiver: Found absolute axes
    [ 45267.685] (--) Logitech USB Receiver: Found keys
    [ 45267.685] (II) Logitech USB Receiver: Configuring as mouse
    [ 45267.685] (II) Logitech USB Receiver: Configuring as keyboard
    [ 45267.685] (II) Logitech USB Receiver: Adding scrollwheel support
    [ 45267.685] (**) Logitech USB Receiver: YAxisMapping: buttons 4 and 5
    [ 45267.685] (**) Logitech USB Receiver: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    [ 45267.685] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:04.0/usb4/4-3/4-3:1.1/input/input6/event6"
    [ 45267.685] (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: KEYBOARD)
    [ 45267.685] (**) Option "xkb_rules" "evdev"
    [ 45267.685] (**) Option "xkb_model" "evdev"
    [ 45267.685] (**) Option "xkb_layout" "se"
    [ 45267.685] (II) Logitech USB Receiver: initialized for relative axes.
    [ 45267.685] (WW) Logitech USB Receiver: ignoring absolute axes.
    [ 45267.686] (**) Logitech USB Receiver: (accel) keeping acceleration scheme 1
    [ 45267.686] (**) Logitech USB Receiver: (accel) acceleration profile 0
    [ 45267.686] (**) Logitech USB Receiver: (accel) acceleration factor: 2.000
    [ 45267.686] (**) Logitech USB Receiver: (accel) acceleration threshold: 4
    [ 45267.686] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/mouse0)
    [ 45267.686] (II) No input driver/identifier specified (ignoring)
    [ 45267.687] (II) config/udev: Adding input device HDA Digital PCBeep (/dev/input/event4)
    [ 45267.687] (II) No input driver/identifier specified (ignoring)
    [ 45267.692] (II) config/udev: Adding input device PC Speaker (/dev/input/event0)
    [ 45267.692] (II) No input driver/identifier specified (ignoring)

    I seem to have been unclear in my original post. Setting it in Gnome 3 would all be fine and dandy, however although Gnome 3 was installed (upgraded from 2.x), I use fvwm. Gtk etc is still used but I don't see why upgrading a DE I don't use would impair another WM from using the X11 DPI settings. Also changing that setting in Gnome 3 does not affect neither the login screen (GDM) nor anything in fvwm.

  • Cannot send email from Iphone. A setting is off.

    What are the correct settings to send email from my aol account that's included in my I Cloud acct. any suggestions???? Thanks Sue

    Read this
    How do I set up AOL Mail on my iPhone or iPod Touch? - AOL Help

  • HOW TO SET UP PARTNER APPLICATION TO USE SSO OUTSIDE OF PORTAL

    If anyone knows how Portal switches context to run as the db user mapped to the lightweight schema and how it knows the db schema password please let me know.
    Should you have any queries please do not hesitate to contact me on 07775 896738.
    From document Oracle Portal Security Overview on PortalStudio.oracle.com:
    In Single Sign On mode (EnableSSO=Yes in the DAD), mod_plsql determines the name of the light-weight user and mapped database schema by calling
    WPG_SESSION_PRIVATE.GET_LW_USER and WPG_SESSION_PRIVATE.GET_DB_USER respectively.
    ** These calls are done using the Portal Schema (PORTAL30) and Portal schema password **
    mod_plsql then executes the procedure in the requested URL by using the N-Tier Authentication feature to connect to the database as the user returned from
    WPG_SESSION_PRIVATE.GET_DB_USER. ..... Note that N-Tier Authentication requires all schemas to be used for Portal user mappings to be granted 'connect
    through' privleges to the Portal schema (PORTAL30).
    The WWCTX packages are also used.
    So this is how it works with standard Portal
    - the document states that the WPG_SESSION_PRIVATE package is only accessible to the Portal schema
    - but I checked and it is also available to PORTAL30_SSO
    SQL> desc WPG_SESSION_PRIVATE
    PROCEDURE CREATE_SESSION
    Argument Name Type In/Out Default?
    P_COOKIE_NAME VARCHAR2 IN
    FUNCTION GET_DB_USER RETURNS VARCHAR2
    FUNCTION GET_LW_USER RETURNS VARCHAR2
    PROCEDURE GET_SESSION_INFO
    Argument Name Type In/Out Default?
    NUM_PARAMS NUMBER OUT
    PARAM_NAMES TABLE OF VARCHAR2(32000) OUT
    PARAM_VALUES TABLE OF VARCHAR2(32000) OUT
    PROCEDURE RESET_SESSION
    Argument Name Type In/Out Default?
    P_COOKIE_NAME VARCHAR2 IN
    In my case only the Login Server (PORTAL30_SSO) is going to be used/installed
    - the SAMPLE_SSO_PAPP application will only work if the DAD used to access is it set to use Basic authentication, i.e. the actual integration with the Login Server
    is done in the sample application code calls, stored in the database
    - when a DAD has enableSSO=yes it automatically accesses Portal (PORTAL30) packages to implement N-Tier authentication
    I'm currently testing:
    1. Configuring the SAMPLE_SSO_PAPP sample as documented with a DAD with Basic authentication
    2. Amending the ssoapp procedure to set context to another (db) user on successful authentication:
    wwctx_api.set_context (
    p_user_name => 'SCOTT',
    p_password => 'TIGER' );
    3. If this works then set_context with get_lw_user instead
    I have now amended the ssoapp procedure as follows to print out
    1. The userid entered when the login box is presented
    2. The Database user which the Portal Lightweight user is mapped to
    3. The Lightweight user Portal has used for authentication
    Amendments to papp.pkb:
    (ssoapp procedure, declare db_user_info and lw_user_info as VARCHAR2 in declare section)
    htp.p('Congratulations! It is working!<br>');
    db_user_info := wwctx_api.get_db_user;
    lw_user_info := wwctx_api.get_user;
    htp.p('User Information:' || l_user_info || '<br>');
    htp.p('DB User Information:' || db_user_info || '<br>');
    htp.p('LW User Information:' || lw_user_info || '<br>');
    The following shows the interesting results from my testing:
    - if the user owning the sample_sso_papp package is PORTAL30_SSO then the call to wwctx_api.get_db_user succeeds
    - if the user owning the sample_sso_papp package is a non-portal schema e.g. SSOAPP below the call to wwctx_api.get_db_user generates a User Defined exception
    Steps to test:
    Created new schema SSOAPP on the database
    - edited it in Portal and checked the use this schema for Portal users checkbox
    - created new Lightweight user SSO_LW in Portal, mapped it to SSOAPP schema
    - created new Lightweight user SSO_SCOTT in Portal, mapped to SCOTT schema
    - loadjava -user ssoapp/ssoapp@portal30 SSOHash.class
    - sqlplus portal30/portal30@portal30
    @provsyns ssoapp
    - sqlplus ssoapp/ssoapp@portal30
    @loadsdk.sql
    @loadpapp.sql
    Created DAD with basic authentication SAMPLE_SSO_PAPP
    - username: ssoapp
    - default home page: sample_sso_papp.ssoapp
    Registered the Sample SSO Partner Application with the Login Server and ran regapp.sql
    Commented out the calls to get_db_user in papp.pkb to avoid exception
    - called http://<server>/pls/sample_sso_papp
    - logged on as SSO_LW/sso_lw
    - got output:
    Congratulations! It is working!
    User Information: SSO_LW
    LW User Information: PUBLIC
    So the Portal lightweight user is not returned as SSO_LW
    if anyone knows why the Lightweight User in my test is returned as PUBLIC not SSO_LW
    Best Regards
    MIchael

    http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox

Maybe you are looking for