Forcing a component to be the root focus owner

I've never really understood how focus works in Java, and even with the new focus technology I'm still struggling!!!
I am trying to build an instant messenger dialog box. It is just a JFrame with a JTextPane inserted in "Center" and a JTextField inserted in "South" (by the way, there is no button - just pressing enter sends the message). I want the JTextField to have focus when the box opens up but I can't get it to do such a simple thing!!! Could someone help???
Thanks.
Andrew

Thanks for your help. Here is my code. Also, I am using JDK1.4 but I would like to make it work in 1.3 if possible.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.text.*;
public class InstantMessageBox extends JFrame
     public InstantMessageBox()
          setTitle( "DMST - Instant Message Box" );
          setSize( 350, 250 );
          addWindowListener( new WindowAdapter()
                    public void windowClosing( WindowEvent we )
                         System.exit( 0 );
               DefaultKeyboardFocusManager focus_manager = new DefaultKeyboardFocusManager();
               Container content_pane = getContentPane();
               JTextPane text_area = new JTextPane();
               text_area.setEditable( false );
               SimpleAttributeSet red_attr = new SimpleAttributeSet();
               StyleConstants.setForeground( red_attr, Color.red );
               SimpleAttributeSet blue_attr = new SimpleAttributeSet();
               StyleConstants.setForeground( blue_attr, Color.blue );
               StyledDocument sd = text_area.getStyledDocument();
               try
                    sd.insertString( sd.getLength(), "<peter> Hello James... how are you?\n", red_attr );
                    sd.insertString( sd.getLength(), "<james> Oh, hello.\n", blue_attr );
               catch( BadLocationException ble )
                    System.out.println( ble );
               JScrollPane text_area_scroll = new JScrollPane( text_area );
               text_area_scroll.setBackground( Color.white );
               Border display_matte_border = BorderFactory.createMatteBorder( 4, 4, 4, 4, Color.blue );
               Border display_titled_border = BorderFactory.createTitledBorder( display_matte_border, "Display Area" );
               text_area_scroll.setBorder( display_titled_border );
               content_pane.add( text_area_scroll, "Center" );
               JTextField text_field = new JTextField( 10 );
               text_field.requestFocus();
               Border input_matte_border = BorderFactory.createMatteBorder( 4, 4, 4, 4, Color.blue );
               Border input_titled_border = BorderFactory.createTitledBorder( input_matte_border, "Input Area" );
               text_field.setBorder( input_titled_border );
               content_pane.add( text_field, "South" );
               System.out.println("The current focus owner is " + focus_manager.getFocusOwner());
     public static void main( String[] args )
          JFrame message_box = new InstantMessageBox();
          message_box.show();
}

Similar Messages

  • Focus the third component after the current focus owner

    Hi,
    I have a component which consists of a textfield with two buttons right of it. I have several of these components placed on a panel. I want, when enter pressed, the focus moved from a textfield, to the second textfield in line. I tried this by calling
    KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent();three times but after going to 1 focusNextComponent it stops. Visually, it goes to the next but when I call
    KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    it is 1 step behind. Do I have to update anything when calling focusNextComponent()?
    Much thanks,
    Hugo

    Will this help?
    Execute the programme and press enter and the focus is gone to the third component.
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class FocusTest extends JFrame implements KeyListener
         JTextField jtf1,jtf2,jtf3;
         JPanel p;
         public FocusTest()
              jtf1 = new JTextField(10);
              jtf2 = new JTextField(10);
              jtf3 = new JTextField(10);
              jtf1.addKeyListener(this);
              p       = new JPanel();
              p.add(jtf1);
              p.add(jtf2);
              p.add(jtf3);
              getContentPane().add(p);
         public static void main(String dd[])
              FocusTest ft = new FocusTest();
              ft.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              ft.setSize(200,200);
              ft.setVisible(true);
         public void keyPressed(KeyEvent ke)
              if(ke.getKeyCode() == KeyEvent.VK_ENTER)
                   System.out.println("ll");
                   jtf3.requestFocus();
         public void keyReleased(KeyEvent ke)
         public void keyTyped(KeyEvent ke)
    }

  • How do I force a file download from a folder above the root?

    I am new to ColdFusion and need some help. I set up a virtual folder on my website and then mapped in the CF9 admin panel to a "Docs" folder above my root, where I would like to store sensitive documents. CF tags are enabled.
    I know that my mapping is set up correctly, because when I set up a cfm page with the following code, I can successfully download the file:
    <cfheader name="Content-Disposition" value="attachment; filename=Calendar.pdf">
    <cfcontent type="application/pdf file=/Docs/Calendar.pdf">
    But what I need is to create one cfm age that will be able to handle downloads of multiple files types and names from the folder above my root.
    I then found Duke Snyder's solution on an older forum for the "click link and download file" question where he suggests making a "download.cfm" page with the following code:  I did this, and named the file "download.cfm"
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "foo/bar" file = "/Docs/#Url.FileName#">
    Then Duke suggests: "Now I pass the FileName through the Url and it WILL ask if you want to open or download the file. We accomplish this by making up an eronious file type."
    I then set up a password-protected page on the site that lists the titles of a number of documents, with links to the virtual folder, where they can be downloaded.  One of the links, which goes to "Calendar.pdf" I constructed as: "download.cfm?FileName=Calendar.pdf"  When I click on the link, I get the popup box that says "Do you want to open or save this file?  With the name listed as: "download.cfm?Filename=Calendar_pdf"
    When I click "Save", I get the message: "Internet Explorer cannot download download.cfm from www.... Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found. Please try again later.
    I must have constructed the link incorrectly. Any ideas?  Thanks in advance for your help.

    I am trying to force the download of pdf files from a folder above the root.  The file below is named "download.cfm"  I pass the name of the file (Calendar.pdf) in the URL link, as follows: download.cfm?filename=Calender.pdf
    In the ColdFusion admin panel, I mapped a folder in the root "Docs"  to point to a folder with a different name above the root.   I have tried the code below, which was generously supplied by another member of this forum, but it does not seem to recognize the CF mapping. Do I need to use another CF Tag for the mapping to working correctly?
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "application/pdf" file = "/Docs/#Url.FileName#">
    Thanks for your help

  • Jdev11g: Possibility to determine component which has the focus ?

    Hi,
    we have a customer request to display (internal) informations about the field and the corresponding VO which has the cursor focus at the moment (for problem analysis purpose)
    If the mouse cursor is in an input field and the user press a button or select a context menu he want to see this information e.g. in a popup.
    Is it possible to determine the component ID of the field which has the focus? (hopefully the input field does not loos the focus if user opens e.g. the context menue)
    If yes, whats the best way to find from the component ID to the corresponding VO?
    11g, ADF BC
    regards
    Peter

    Peter, sorry for the mix up.
    getContextComponent(..) is one of my private helper methods for a special case. I think you don't need it in your case. Check the UIComponent you get back from actionEvent.getSource() if it's the input field you are looking for, if not check its parent.
    In my method I walk down the component tree to get a special component I'm interested in.
    Heres the code:    private UIComponent getContextComponent(UIComponent aUI)
            try
                UIComponent ui3 = aUI.getParent().getParent();
                Map<String, Object> attr = ui3.getAttributes();
                String obj2 = (String) attr.get("_launchId");
                UIComponent uiXXXX = JSFUtils.findComponentInRoot((String) obj2);
                if (uiXXXX.getChildCount() > 0)
                    UIComponent uiC = uiXXXX.getChildren().get(0);
                    return uiC;
                else
                    return uiXXXX;
            catch (Exception e)
            return null;
        }Timo

  • Stopping tab from moving to the next focus component

    I have a single TextInput field in my component and I want to
    stop the tab key from advancing the focus when I have an error in
    the field. I have tried using setFocus() and that seems to do it
    although I lose the caret in the text input field. Also when I tab
    I notice that even though I am telling the component that the next
    focus is the TextInput field it still goes to the Internet Explorer
    address bar. Any ideas?

    Append the system's line separator usingjava.lang.System.getProperty( "line.separator" );Then the added line will be placed as you've wanted. Code will be written like below:yourTextArea.append( System.getProperty( "line.separator" ) );
    yourTextArea.append( yourStringToAppend );Hope it helps.

  • How to force JTree to not display  the leaves

    Hi
    Is there anyway to force JTree to not display the "end nodes" so to speak.
    What I want is that if a node is a leaf and is not allowed to have children
    I do not want the JTree to display them.
    I need this to build a component for a custom file system view like Windows Explorer
    which contains a tree with folders on the left and and contents of the currently selected( expanded)
    folder on the right. But Explorer does not display any files in the left pane, only folders.
    So I need to implement the same in my component

    This will give you some things to think aboutimport java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    import java.util.*;
    public class Test3 extends JFrame {
      Vector nodes = new Vector();
      DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
      DefaultTreeModel dtm = new DefaultTreeModel(root);
      JTree jt = new JTree(dtm);
      JCheckBox jcb = new JCheckBox("Allow Expansion");
      Random r = new Random();
      int nodeCount=0;
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        addNodes(root,0);
        content.add(jcb, BorderLayout.NORTH);
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.addTreeWillExpandListener(new TreeWillExpandListener() {
          public void treeWillCollapse(TreeExpansionEvent tse) {}
          public void treeWillExpand(TreeExpansionEvent tse) throws ExpandVetoException{
            if (jcb.isSelected()) return;
            TreeNode tn = (TreeNode)tse.getPath().getLastPathComponent();
            Enumeration e = tn.children();
            boolean expand = false;
            while (!expand && e.hasMoreElements()) {
              if (((TreeNode)e.nextElement()).getChildCount()!=0) expand  = true;
            if (!expand) throw new ExpandVetoException(tse);
        setSize(400, 400);
      private void addNodes(DefaultMutableTreeNode parent, int level) {
        int cnt = r.nextInt(3)+3-level;
        for (int i=0; i<cnt; i++) {
          DefaultMutableTreeNode node = new DefaultMutableTreeNode("Node"+nodeCount++);
          parent.add(node);
          nodes.add(node);
          addNodes(node, level+1);
      public static void main(String[] args) { new Test3().setVisible(true); }
    }

  • JTreeTable component anytime in the future?

    My question is simply whether or not there will be a JTreeTable component in the future?
    I've read Sun's little JTreeTable tutorial (it's kind of dated but it did the job). I created my own TreeTableModel, but I resorted to using Sun's abstract classes and JTreeTable.
    My self-directed project involves getting Foo objects that contain a Vector of child Foo objects and displaying them visually onto a JTreeTable. On top of that, the root node is not a Foo object, instead both it and all Foo objects implement an interface I wrote so that they appear nicely in the JTreeTable.
    Everything works, (it appears that way at least), but I don't feel good about using all that code that I didn't write. That's the reason for me asking the question.

    In short, yes. Don't get me wrong, the code is great and it works. I had to painstakingly adapt TreeTableModel to fit my purposes and I learnt a lot (my main reason for trying to create my program). It's just:
    a) I don't fully understand the code that I haven't written (I'm getting there though)
    b) I'm not really giving credit to the people who wrote it ( I didn't change any of the source files apart from adding tree.setRootVisible(false); to one of the files.
    c) My high school career has forcefully injected the idea "Do not plagiarise" into my head (i'd say figuratively but my head does hurt at times)

  • Problem with the MenuBar and how can i delete a own component out of the storage

    Hello,
    I opened this thread in the category "Flex Builder 2", but
    under this category my questions fit better.
    I have a problem with the MenuBar and a question to delete a
    component out of storage.
    1. We have implemented the MenuBar, which was filled
    dynamically with XML data.
    Sporadically it will appear following fault, if we "mousover"
    the root layer.
    RangeError: Error #2006: Der angegebene Index liegt
    außerhalb des zulässigen Bereichs.
    at flash.display::DisplayObjectContainer/addChildAt()
    at mx.managers::SystemManager/
    http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()
    at mx.managers::SystemManager/addChild()
    at mx.managers::PopUpManager$/addPopUp()
    at mx.controls::Menu/show()
    at mx.controls::MenuBar/::showMenu()
    at mx.controls::MenuBar/::mouseOverHandler()
    Here a abrid ged version of our XML to create the MenuBar:
    <Menuebar>
    <menu label="Artikel">
    <menu label="Artikel anlegen" data="new_article" />
    <menu label="Artikel bearbeiten" data="edit_article" />
    <menu label="Verpackung">
    <menu label="Verpackung anlegen" data="new_package" />
    <menu label="Verpackung bearbeiten" data="edit_package"
    />
    </menu>
    <menu label="Materialgruppe">
    <menu label="Materialgruppe anlegen"
    data="new_materialgroup" />
    <menu label="Materialgruppe bearbeiten"
    data="edit_materialgroup" />
    </menu>
    </menu>
    </Menuebar>
    It is a well-formed XML.
    2. Delete a component out of storage
    We have some own components (basically forms), which will be
    created and shown by an construct e.g.
    var myComponent : T_Component = new T_Component ;
    this.addChild(myComponent)
    Some of our forms will be created in an popup. On every call
    of the popup, we lost 5 mb or more, all childs on the windows will
    be removed by formname.removeAllChild();
    What cann we do, that the garbage collector will dispose this
    objects.
    Is there a way to show all objects with references (NOT
    NULL)?
    I have read in the Flex Help, that
    this.removeChild(myComponent) not delete the form and/or object out
    of the storage.
    Rather the object must be destroyed.
    It is sufficient to call delete(myComponent) about remove
    this object out of the storage as the case may be that the
    garbage-collector remove this object at any time?
    Or how can I destroy a component correctly. What happens with
    the widgets on this component e.g. input fields or datagrids?
    Are they also being deleted?
    Thanks for your help.
    Matze

    If you mena the "photo Library" then you cannot delete it.
    This is how iphone handles photos.  There are not two copies.  There a re simply two places from which to access the same photos.  ALL photos synced to iphone can be accessed via Photo Library.  Those same pics can be accessed via their individual folder.

  • Import Error: The root directory does not exist

    Hi,
    I have some isuuses with importing the extended page. When I try to Import it throws an error.
    Root Directory does not exist.
    I am using the following command.
    import c:\jdev\jdevhome\jdev\myprojects\oracle\apps\asn\opportunity\webui\EMCOpptyDetPG.xml -includeSubpackages -validate -rootdir c:\prabhat\Jdev\jdevhome\jdev\myprojects -mmddir C:\prabhat\Jdev\jdevhome\jdev\myhtml\OA_HTML\jrad -userId 1 -username apps -password apps -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =xxxx)(port =xxx)))(connect_data = (sid = xxxx)))" -jdk13
    Importing /oracle/apps/asn/opportunity/webui/EMCOpptyDetPG
    Validation warnings in document "/oracle/apps/asn/opportunity/webui/EMCOpptyDetP
    G":
    Importing /oracle/apps/asn/opportunity/webui/EMCOpptyDetPG
    Validation warnings in document "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG":
    Invalid value "/oracle/apps/pv/opportunity/webui/PvOpptyPartnerRN" for property
    "Extends" on component "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNSubt
    abPrmRN". Component "/oracle/apps/pv/opportunity/webui/PvOpptyPartnerRN" cannot
    be referenced from "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNSubtabPr
    mRN" because it violates scope restrictions.
    Invalid value "/oracle/apps/jtf/cac/task/webui/CacTaskSummRN" for property "Exte
    nds" on component "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNSubtabTas
    kRN". Component "/oracle/apps/jtf/cac/task/webui/CacTaskSummRN" cannot be refere
    nced from "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNSubtabTaskRN" bec
    ause it violates scope restrictions.
    The component "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNSubtabTaskRN"
    cannot contain "/oracle/apps/jtf/cac/task/webui/CacTaskSummRN.CacSmrTable" of t
    able style because it is inside "tableLayout".
    The component "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNSubtabTaskRN"
    cannot contain "/oracle/apps/jtf/cac/task/webui/CacTaskSummRN.CacSmrTaskButtonR
    N" of stackLayout style because it is inside "tableLayout".
    Invalid value "/oracle/apps/pv/opportunity/webui/PvAbandonOpptyRN" for property
    "Extends" on component "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNPrmS
    tack". Component "/oracle/apps/pv/opportunity/webui/PvAbandonOpptyRN" cannot be
    referenced from "/oracle/apps/asn/opportunity/webui/EMCOpptyDetPG.ASNPrmStack" b
    ecause it violates scope restrictions.
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Error: The root directory does not exist
    Import completed.
    But After this when I try to see from the server there is no file with name EMCOpptyDetPG.xml exist. So I think this file is not imported.
    Could suggest how to solve this problem.
    Thanks
    Prabhat

    Hi Tapash
    while deploying a page to mds Repository i m getting the same error that root Directory does not exist but it also says that import completed successfully.
    when i see the same using jdr_utils.listDocuments('xxxx/oracle/apps/ak/server/webui/xxxPG')
    it says printing /xxxx/oracle/apps/ak/server/webui/xxxPG thus page is available in the mds repository and i m able to access the page at run time
    my concern is why i m getting this error
    my import command looks like this
    java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/xxxx/oracle/apps/ak/server/webui/xxxxPG.xml -jdk13 -mmddir $OA_HTML/jrad -username apps -password apps -rootdir $JAVA_TOP -validate -dbconnection " (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xyxyxyxyxy)(PORT = xyxyx)) (CONNECT_DATA = (SID =yyy)))"
    could u pls suggest some solution.

  • Adding new node to the Clusterware fails with the root.sh script.

    Dear All,
    I had successfully added third node to the existing 2 node cluster. After adding new node I need to run the root.sh scripts, but it was faling with the below error.
    Please help me with the below issue:
    Instantiating scripts for add node (Monday, April 8, 2013 3:23:14 PM EDT)
    . 1% Done.
    Instantiation of add node scripts complete
    Copying to remote nodes (Monday, April 8, 2013 3:23:16 PM EDT)
    ............................................................................................... 96% Done.
    Home copied to new nodes
    Saving inventory on nodes (Monday, April 8, 2013 3:31:40 PM EDT)
    . 100% Done.
    Save inventory complete
    WARNING:
    The following configuration scripts need to be executed as the "root" user in each new cluster node. Each script in the list below is followed by a list of nodes.
    /u01/app/11.2.0/grid/root.sh #On nodes svphxwgdbprd06
    To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts in each cluster node
    The Cluster Node Addition of /u01/app/11.2.0/grid was successful.
    Root.SH Script Log:
    [root@svphxwgdbprd06 ~]# /u01/app/11.2.0/grid/root.sh
    Performing root user operation for Oracle 11g
    The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /u01/app/11.2.0/grid
    Enter the full pathname of the local bin directory: [usr/local/bin]:
    The contents of "dbhome" have not changed. No need to overwrite.
    The contents of "oraenv" have not changed. No need to overwrite.
    The contents of "coraenv" have not changed. No need to overwrite.
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
    Creating trace directory
    User ignored Prerequisites during installation
    OLR initialization - successful
    Adding Clusterware entries to inittab
    CRS-2672: Attempting to start 'ora.mdnsd' on 'svphxwgdbprd06'
    CRS-2676: Start of 'ora.mdnsd' on 'svphxwgdbprd06' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'svphxwgdbprd06'
    CRS-2676: Start of 'ora.gpnpd' on 'svphxwgdbprd06' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'svphxwgdbprd06'
    CRS-2672: Attempting to start 'ora.gipcd' on 'svphxwgdbprd06'
    CRS-2676: Start of 'ora.cssdmonitor' on 'svphxwgdbprd06' succeeded
    CRS-2676: Start of 'ora.gipcd' on 'svphxwgdbprd06' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'svphxwgdbprd06'
    CRS-2672: Attempting to start 'ora.diskmon' on 'svphxwgdbprd06'
    CRS-2676: Start of 'ora.diskmon' on 'svphxwgdbprd06' succeeded
    CRS-2676: Start of 'ora.cssd' on 'svphxwgdbprd06' succeeded
    ASM created and started successfully.
    Disk Group DATA created successfully.
    clscfg: -install mode specified
    clscfg: EXISTING configuration version 5 detected.
    clscfg: version 5 is 11g Release 2.
    Successfully accumulated necessary OCR keys.
    clscfg: Arguments check out successfully.
    NO KEYS WERE WRITTEN. Supply -force parameter to override.
    -force is destructive and will destroy any previous cluster
    configuration.
    Failed to initialize Oracle Cluster Registry for cluster, rc 105
    Oracle Grid Infrastructure Repository configuration failed at /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 6818.

    The document references posted already are very good ones. However, I would say that on personal experience (on Solaris and 10gR2) that the addnode tools gave me nothing but problems. Luckily, I was able to build a parallel cluster (with three nodes) on other hardware and then move the databases across via DataGuard. It was quicker and cleaner (and easier!) that way...
    Good luck!

  • How do you get the root folder to recognize updated file in nested folder?

    I believe in OS 9, a modified file nested in a folder would trigger the root folder to recognize and update to the top of the "date modified" column. As long as I've used the Mac (20 years) I've used the "date modified" to force my current client folders to the top of the column. Lately, I have many nested folders in the root client folder. When I make changes to a file in a nested folder, OS X doesn't make the root folder recognize changes within a nested folder. I realize there is not likely to be a fix for this in OS X, as Apple probably deems this behavior to be proper (I do not,) so my question would be expanded to include suggestions for third party software that may accomplish this.

    Sorry, posted that last post and ran out of time while editing it. It should read like this:
    "Yes, if you ADD a new item or folder to a folder, it updates the root folder, but if you simply MODIFY a file (like Photoshop) within a subfolder, the root folder WILL NOT update the date modified. Check it out."
    Actually, whether the directory that a file is re-saved in will be modified or not can depend on the application in question and how it saves files.
    Let's say a folder has a single file in it. The modification date of the folder will be the last time a change was made to the directory, either by adding or removing an item from it. (This can include the invisible .DS_Store file in which the Finder saves view settings for a folder, which can often be written without you're realizing it unless you have the Finder show all files like I do).
    Then, let's say you open that file, which is a stream of bytes, in an application. You make some changes which alters the representation of the stream of bytes in RAM. The application then saves the changes to the file by filling it with the stream bytes as they now are in RAM. Modifying the contents of a file in this manner does not alter the directory that it's in. The modified date of the folder should remain unchanged.
    Some applications use a different method than above to save files, however. Let's say that theoretically while the application is re-writing to the original file during a save, the power goes out and your computer shuts down. There's a good chance that the document that was being saved is now corrupt. A safer method that some applications use, is to first write out the information to a new file in the same directory as the original file, then delete the original file, and then rename the new file so that it has the same attributes as the old file. This method will, of course, modify the directory that the original file was in by adding and removing a file.
    Dual 2.7GHz PowerPC G5 w/ 2.5 GB RAM; 17" MacBook Pro w/ 2 GB RAM -   Mac OS X (10.4.8)  

  • [SOLVED] PekWM themes - the root menu

    Is it possible to remove/change the 'title bar' of the root menu in pekwm? It is currently the same as all of my windows and I'd like it as something else/removed.
    Solution: Menus and Windows have different themes, I had them set to the same in the theme file.
    Last edited by BaconPie (2010-11-11 09:37:56)

    kittykatt wrote:What theme are you using?
    My own theme, which I used the default one as a template. Here is the file:
    $ cat .pekwm/themes/BlueLine-pekwm_0.1.12/theme
    # BlueLine, a PekWM 0.1.12 theme
    # Extract this theme directory under ~/.pekwm/themes/ and the
    # themes menu will pick it up automatically.
    # Changelog:
    $FONT = "XFT#Sans:size=7#Left"
    $FONT_TITLE = "XFT#Sans:size=7#Left"
    Define = "BaseDecor"
    Height = "17"
    # Increase first number to bring title text downwards
    Pad = "1 5 5 0"
    Focused = "Image titlebar.png"
    Unfocused = "Image titlebar_unfocus.png"
    Tab
    Focused = "Image titlebar.png"
    FocusedSelected = "Image titlebar.png"
    Unfocused = "Image titlebar_unfocus.png"
    UnfocusedSelected = "Image titlebar_unfocus.png"
    Separator
    Focused = "Image tab-separator.png"
    Unfocused = "Image tab-separator_unfocus.png"
    Font
    Focused = "$FONT_TITLE"
    FontColor
    Focused = "#FFFFFF"
    FocusedSelected = "#FFFFFF"
    Unfocused = "#c3c3c3"
    UnfocusedSelected = "#c3c3c3"
    Border
    Focused
    TopLeft = "Image top-left.png"
    Top = "Image top-border.png"
    TopRight = "Image top-right.png"
    Left = "Image left-border.png"
    Right = "Image right-border.png"
    BottomLeft = "Image bottom-left.png"
    Bottom = "Image bottom-border.png"
    BottomRight = "Image bottom-right.png"
    Unfocused
    TopLeft = "Image top-left_unfocus.png"
    Top = "Image top-border_unfocus.png"
    TopRight = "Image top-right_unfocus.png"
    Left = "Image left-border_unfocus.png"
    Right = "Image right-border_unfocus.png"
    BottomLeft = "Image bottom-left_unfocus.png"
    Bottom = "Image bottom-border_unfocus.png"
    BottomRight = "Image bottom-right_unfocus.png"
    Define = "BaseButtons"
    Buttons
    Right = "Close"
    Focused = "Image close.png"
    Unfocused = "Image close_unfocus.png"
    Hoover = "Image close_hover.png"
    Pressed = "Image close_pressed.png"
    Button = "1" { Actions = "Close" }
    Button = "3" { Actions = "Kill" }
    Right = "Maximize"
    Focused = "Image max.png"
    Unfocused = "Image max_unfocus.png"
    Hover = "Image max_hover.png"
    Pressed = "Image max_pressed.png"
    Button = "1" { Actions = "Toggle Maximized 1 1" }
    Right = "Iconify"
    Focused = "Image min.png"
    Unfocused = "Image min_unfocus.png"
    Hover = "Image min_hover.png"
    Pressed = "Image min_press.png"
    Button = "1" { Actions = "Set Iconified" }
    Left = "Shade"
    Focused = "Image shade.png"
    Unfocused = "Image shade_unfocus.png"
    Hover = "Image shade_hover.png"
    Pressed = "Image shade_pressed.png"
    Button = "1" { Actions = "Toggle Shaded" }
    Define = "EmptyDecor"
    Focused = "Empty"
    Unfocused = "Empty"
    Tab
    Focused = "Empty"
    FocusedSelected = "Empty"
    Unfocused = "Empty"
    UnfocusedSelected = "Empty"
    Separator
    Focused = "Empty"
    Unfocused = "Empty"
    Font
    Focused = "Empty"
    FontColor
    Focused = "Empty"
    FocusedSelected = "Empty"
    Unfocused = "Empty"
    UnfocusedSelected = "Empty"
    Border
    Focused
    TopLeft = "Empty"
    Top = "Empty"
    TopRight = "Empty"
    Left = "Empty"
    Right = "Empty"
    BottomLeft = "Empty"
    Bottom = "Empty"
    BottomRight = "Empty"
    Unfocused
    TopLeft = "Empty"
    Top = "Empty"
    TopRight = "Empty"
    Left = "Empty"
    Right = "Empty"
    BottomLeft = "Empty"
    Bottom = "Empty"
    BottomRight = "Empty"
    PDecor
    Decor = "Default"
    Title
    @BaseDecor
    @BaseButtons
    Decor = "Menu"
    Title
    @BaseDecor
    Decor = "Titlebarless"
    Title {
    @EmptyDecor
    Decor = "Statuswindow" {
    Title
    @EmptyDecor
    Harbour
    Texture = "Solid #f9f9f9"
    Menu
    Pad = "1 1 4 1"
    Focused
    Font = "$FONT"
    Background = "Solid #FFFFFF"
    Item = "Empty"
    Text = "#000000"
    Separator = "Image menuline.png#Scaled"
    Arrow = "Image arrow.png"
    Unfocused
    Font = "$FONT"
    Background = "Solid #FFFFFF"
    Item = "Empty"
    Text = "#000000"
    Separator = "Image menuline.png#Scaled"
    Arrow = "Image arrow.png"
    Selected
    Font = "$FONT"
    Background = "Solid #000000"
    Item = "Image item_focus.png"
    Text = "#ffffff"
    Arrow = "Image arrow_selected.png"
    CmdDialog
    Font = "$FONT"
    Texture = "Solid #ffffff"
    Text = "#000000"
    Pad = "3 0 1 10"
    Status
    Font = "$FONT"
    Texture = "Solid #ffffff"
    Text = "#8b8b89"
    Pad = "2 2 10 10"
    What do I change?

  • Do we have any method to list out the servers that are critical and the component/monitor causing the server to turn into critical state in SCOM 2012

    Hello Team,
    We are monitoring 1000 servers in our environment and out of 1000 servers, we have approximately 100 servers showing as critical state on the server state view.
    We can get the critical servers list from SCOM console, but we are not able to get the information about the component responsible for the server to be critical. Using Health explorer to find the root cause for 100 servers is really impossible and time consuming.
    Do we have any method to list out the servers that are critical and the component/monitor causing the server to turn into critical state?
    Advance thanks for your help.
    Regards,
    Dinesh
    Thanks &amp; Regards, Dinesh

    Hi,
    As far as I know alerts with severity as criticla may cause windows computer in a critical state, we can try below code to find all critical alerts:
    get-alert -criteria 'ResolutionState=0 AND Severity=2' | select Name,ResolutionState,TimeRaised | export-csv c:\Alerts.txt
    Criteria Syntax http://msdn.microsoft.com/en-us/library/bb437603.aspx
    Values to use.
    Resolution State 
    Severity Values for Alerts
    0       =   New
    0 = INFORMATIONAL
    255   =   Closed
    1 = WARNING
    2 = CRITICAL
    Hope this helps.
    Regards,
    Yan Li
    Regards, Yan Li

  • GPO to prevent users from accessing the root folder of their profile doesn't work

    Hi,
    Here's the scenario:
    In a Windows 2012 RDS I created two groups called RemoteApp users and remote desktop users.
    These groups are defined in the collection for the corresponding RD Session hosts.
    These groups are not included in any other group, but they are located under an OU -called  Remote Users.
    In the domain controller I have created a GPO named "Restrict access to root drive"  which is linked to the Remote Users OU.
    The GPO I selected is - "Prevent users from adding files to the root of their users files folder"
    This doesn't seem to work. I have waited more than a few hours to allow the 90 minutes update, plus used the gpupdate /force
    but when a user clicks on the RemoteApp (Excel in this example) then access to the C: drive (which is the root folder of the user's profile) is enabled, and the user can create folders and save files under C:.
    I tried to run gpresult for the specific user but the GPO I created wasn't mentioned.
    I thought this would be a straight forward mechanism, but somehow it looks like something is missing.
    I have read about loopback and expanding, but not sure if this is what needs to be done, and if yes - I'd appreciate if I can get  step by step instructions. Everything I found so far was VERY vague.
    Thanks !
    One more detail that may be relevant - the DC is a Windows Server 2012, and the session host is a Windows 2012 R2.

    > These groups are not included in any other group, but they are located
    > under an OU -called  Remote Users.
    >
    > In the domain controller I have created a GPO named "Restrict access to
    > root drive"  which is linked to the Remote Users OU.
    >
    The USER accounts need to be in the OU your GPO is linked to. Despite
    their name, GPOs do NOT apply to groups, but to users (and computers).
    Groups only provide an additional layer of filtering...
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • [solved] Unable to find the root device after an upgrade - diff. case

    Background: I recently upgraded my installation done in August 2011 to the most recent packages with 'pacman -Syu' - which, amongst some other minor issues that I fixed,  apparently broke my installation's boot sequence. Not sure if this is relevant, but I forced the upgrade as it's been prescribed here.
    Note to self: do backups before any major upgrades like this.
    Problem: The problem is of the same origin as seen in this post - systems lets me know it cant access the root partition anymore. I'm halfway through the procedure that pineapple-biku suggested but since my partition layout is different - and - because I don't have much understanding of what *exactly* I'm supposed to do and accomplish, I'm stuck for now.
    What is the best way to find out the exact labels of encrypted volumes and their corresponding kernel device IDs (i.e. /dev/sda6 for 'tmp' and so on)? I have several volumes of the same size, thus it's hard to guess which is which without knowing for sure.
    Details: My setup has an unencrypted '/boot' partition and 7 other encrypted partitions, including /root, /usr and others. These are contained within a single extended partition.
    Any help will be greatly appreciated. In case I've left out some important information, let me know, and I'll do my best to provide it.
    Last edited by Raija (2012-02-28 03:06:25)

    Thank you both for your assistance. Some more understanding was exactly what I was in need of.
    falconindy wrote:The news item you posted says to force the installation of a single package, not the entire upgrade. These two things are not equivalent.
    Thanks for pointing that out. I'm still a newbie when it comes to Pacman, thus prone to such mistakes.
    Gcool wrote:
    Raija wrote:What is the best way to find out the exact labels of encrypted volumes and their corresponding kernel device IDs (i.e. /dev/sda6 for 'tmp' and so on)? I have several volumes of the same size, thus it's hard to guess which is which without knowing for sure.
    # ls -lah /dev/disk/by-label
    # ls -lah /dev/disk/by-id
    # ls -lah /dev/disk/by-uuid
    This should get you on the way on discovering which disk is what exactly (you'll need to know the / and /boot partition in order to fix the issue).
    Thank you. I'll try that.

Maybe you are looking for

  • Mac Pro and 1080 LCD projector

    I have had little success getting a Hi Def LCD projector to display correct resolution from a MacPro simultaneously running a 23" display from the video card. The Projector displays an extremely pixelated image, while the 23" Apple Display reduces it

  • HT201210 iOS 7.1 to 7.11

    Please does anyone know how much HDD free space do I need to upgrade my iPhone 5 from iOS 7.1 to 7.1.1?

  • Filterable="true" - no filters on columns

    hi, how can i return filter caps on top of each column of table. there have been during the creation of table, then it disappeared at some moment so that i can't return it noway ldev 11.1.2.3 when i create a new table, all filtable fields are in plac

  • Proxy settings for installing TREX

    hi all while installing TREX server it is asking following settings <b>Proxy Server Name</b> <b> Proxy Server Port</b> <b> Proxy User Name</b> <b>Proxy User Password</b> is the above settings are mandatory for installing TREX if so,wht info i've to g

  • Path to jdbc libraries

    Which path is more appropriate for jdbc libraries? I'm using usr\sap\J2E\JC00\j2ee\cluster\server0\bin\system\ Is it right?