Small problem in refreshing JFrame

Please help me in sorting out this small problem. I called a function on a button click. In that function i tried to change the text on a button initially then i have some code to execute and then again i set other text to the same button. But iam not able to see the initial text while execution. It is as follows
jbut.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae)
connectServer(); //The function that i called
//conncetServer function
public void connectServer
jbut.setText("Please Wait");
// jbut.validate();
try{
Thread.sleep(10000);
}catch(Exception e)
jbut.setText("Disconnect");
// jbut.validate(); This i tried
But i am not able to see the please wait label on the screen i tried in several ways. can anyone of you tell me how to solve it..

Hi, Problem is Gui manages its own Thread, so once u invoke a process, until it finishes GUI won't get refreshed. 2 ways to handle it.
1. Either use SwingUtilities.invokeLater method
Example Code.
jbut.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae)
jbut.setText("Please Wait...");// set the text
Runnable connectServerThread = new Runnable(){
public void run()
connectServer();
jbut.setText("");// return back to normal.
SwingUtilities.invokeLater(connectServerThread);
or
2. Implement Runnable interface in ur class and invoke the same inside run method. It will definitely work since i checked it.
Example code.
Thread connectServerThread = null;
jbut.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae)
connectServerThread = new Thread(this);
connectServerThread.start();
public void run()
// set the label visible here.
jbut.setText("Please Wait...");
// invoke server process.
connectServer();
// hide the label or button here.
jbut.setText("");
Sreni.

Similar Messages

  • Problem in refreshing JFrame

    Hi,
    I am getting problem in validating JFrame when I intent to remove one panel and try to add another on runtime. I did call a validate() method but still JFrame dose not refresh completely.
    Note: I compile with JDK1.6
    Here is the code
    ///////////////// Code starts here
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Prob extends JFrame implements ActionListener
    Container c;
    JPanel p1;
    JPanel p2;
    public Prob()
         p1=new JPanel();
         p1.setLayout(null);
         JButton bt1=new JButton("Button");
         JTextField tf=new JTextField();
         bt1.setBounds(10,10,100,30);
         bt1.addActionListener(this);
         tf.setBounds(10,100,100,20);
         p1.add(bt1);
         p1.add(tf);
         c=getContentPane();
         c.setLayout(null);
         p1.setBounds(0,0,150,200);
         c.add(p1);
         setSize(150,200);
         setVisible(true);
    public void actionPerformed(ActionEvent e)
              p2=new JPanel();
              p2.setLayout(null);
              p2.setBounds(0,0,150,200);
              JComboBox combobox=new JComboBox();
              combobox.addItem("Item1");
              combobox.addItem("Item2");
              combobox.setBounds(10,10,100,20);
              p2.add(combobox);
              ////////////// I think the problem is in the code below
              c.remove(p1);
              c.add(p2);
              validate();
              //c.validate(); I have also tried this           
    public static void main(String[] args)
              new Prob();
    }

    Since you don't use layout managers I'm not sure that calling validate() really does anything. Maybe you should just call repaint() instead.

  • Problem with refreshing JFrames and JDialogs

    My program is based on few JDialogs and one JFrame. I'm still changing them, one time one of the JDialogs is visible, other time JFrame. During this change I call dispose() for one window or frame and I create (if it wasn't created before) other component and call setVisible(true) for it. Problem is that sometimes (only sometimes! like 5% of calls) my windows appears but they are not refreshing (not showing new objects added to their lists or sth like that) until I resize my window by dragging mouse on the edge of it. Is there anyway to ensure that window will be displayed properly?

    I ran into this problem about a year ago...so I don't really remember but I think a call to validate(), or paint() or repaint() or something like that should do the trick (forgive me for not knowing the exact one but as I said it has been a while). Its been about that year since I stopped coding in java and moved to c#. You want the window to redraw its self what ever that is.

  • Problem in refreshing JTree inside Jscrollpane on Button click

    hi sir,
    i have problem in refreshing JTree on Button click inside JscrollPane
    Actually I am removing scrollPane from panel and then again creating tree inside scrollpane and adding it to Jpanel but the tree is not shown inside scrollpane. here is the dummy code.
    please help me.
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.tree.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.WindowListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    public class Test
    public static void main(String[] args)
         JFrame jf=new TestTreeRefresh();
         jf.addWindowListener( new
         WindowAdapter()
         public void windowClosing(WindowEvent e )
         System.exit(0);
         jf.setVisible(true);
    class TestTreeRefresh extends JFrame
         DefaultMutableTreeNode top;
    JTree tree;
         JScrollPane treeView;
         JPanel jp=new JPanel();
         JButton jb= new JButton("Refresh");
    TestTreeRefresh()
    setTitle("TestTree");
    setSize(500,500);
    getContentPane().setLayout(null);
    jp.setBounds(new Rectangle(1,1,490,490));
    jp.setLayout(null);
    top =new DefaultMutableTreeNode("The Java Series");
    createNodes(top);
    tree = new JTree(top);
    treeView = new JScrollPane(tree);
    treeView.setBounds(new Rectangle(50,50,200,200));
    jb.setBounds(new Rectangle(50,300,100,50));
    jb.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
              jp.remove(treeView);
              top =new DefaultMutableTreeNode("The Java ");
    createNodes(top);
              tree = new JTree(top);
                   treeView = new JScrollPane(tree);
                   treeView.setBounds(new Rectangle(50,50,200,200));
                   jp.add(treeView);     
                   jp.repaint();     
    jp.add(jb);     
    jp.add(treeView);
    getContentPane().add(jp);
    private void createNodes(DefaultMutableTreeNode top) {
    DefaultMutableTreeNode category = null;
    DefaultMutableTreeNode book = null;
    category = new DefaultMutableTreeNode("Books for Java Programmers");
    top.add(category);
    book = new DefaultMutableTreeNode("The Java Tutorial: A Short Course on the Basics");
    category.add(book);
    book = new DefaultMutableTreeNode("The Java Tutorial Continued: The Rest of the JDK");
    category.add(book);
    book = new DefaultMutableTreeNode("The JFC Swing Tutorial: A Guide to Constructing GUIs");
    category.add(book);
    book = new DefaultMutableTreeNode("Effective Java Programming Language Guide");
    category.add(book);
    book = new DefaultMutableTreeNode("The Java Programming Language");
    category.add(book);
    book = new DefaultMutableTreeNode("The Java Developers Almanac");
    category.add(book);
    category = new DefaultMutableTreeNode("Books for Java Implementers");
    top.add(category);
    book = new DefaultMutableTreeNode("The Java Virtual Machine Specification");
    category.add(book);
    book = new DefaultMutableTreeNode("The Java Language Specification");
    category.add(book);
    }

    hi sir ,
    thaks for u'r suggession.Its working fine but the
    properties of the previous tree were not working
    after setModel() property .like action at leaf node
    is not working,I'm sorry but I don't understand. I think you are saying that the problem is solved but I can read it to mean that you still have a problem.
    If you still have a problem then please post some code (using the [code] tags of course).

  • Problem in refreshing the data of the UI element Table

    Hi Experts,
    I am having a problem.
    I have a screen which displays list of variants in table ( variant name , variant desc )
    I am binding the entries of table in WDDOINIT method.
    but when i go back to selection screen view and come back to display variants view, WDDOINIT is not triggering.
    Now if i move the code written in WDDOINIT method to WDDOMODIFYVIEW method, its not retaining the lead selection as the binding happens on every server round trip. if i check with First_time = 'X'. its same as that of having it in WDDOINIT method.
    How do i overcome this problem of refreshing the table data.
    any clue is highly appreciated.
    Regards,
    Ajay

    hi Ajay ,
    create a custom controller for this and when u want to move from selection screen view to display variant ,
    call method of this custom controller
    DATA lo_edit TYPE REF TO ig_edit .
    lo_edit =   wd_this->get_edit_ctr( ).
      lo_edit->edit1(
    here I am calling the edit1 method of my custom controller named EDIT.
    try to move code of ur WDDOINIT here.
    it shud help
    rgds,
    amit

  • Problem with refresh of snapshot

    I am facing one problem with refresh of a snapshot. In the front end (developed in D2K) there is a PL/SQL code written which loops through user_snapshots and refreshes each snapshots one by one.
    With one particular snapshot its giving the error. I traced the session and found the problematic snapshot. I tried to refresh the same snapshot with some other user with DBA role granted to it and its working fine.
    Now I logged in to SQL Plus with the user Z0000 ( This is the user with which the application user logs in to the application) and tried to rerfresh the snapshot. Its giving me ORA-03113 end-of-file on communication channel. Then I granted DBA role to user Z000 and then tried to refresh its again giving the same error.
    I tried with many different users and its working fine.
    Any ideas where could be the problem.
    Thanks
    Sidhu
    Database is 10gR2 on AIX 5.3
    Message was edited by:
    Sidhu

    Hi,
    did you try to do it locally?
    Maybe a possible problem on the network.
    This issue remembers me a bug on older versions.
    It is strange on a 10.2
    Acr

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • Very small problem RE: Variable not initializing

    //Hey, folks! Having a small problem here. Compiler keeps telling me that "result" variable may not have been initialized for this method. This is probably an issue of variable scope? It's staring me in the face and I can't see the problem. Can you see the problem?      
    public Shape randomShape()
              Random generator = new Random();
              intShapeDecider = generator.nextInt(3);
              int intCrdntX1 = generator.nextInt(500);
              int intCrdntY1 = generator.nextInt(500);
              int intCrdntX2 = generator.nextInt(500);
              int intCrdntY2 = generator.nextInt(500);
              int intWidth = Math.abs(intCrdntX1 - intCrdntX2);
              int intHeight = Math.abs(intCrdntY1 - intCrdntY2);
              Shape result;
              if (intShapeDecider == 0)
                   result = new Line2D.Double(intCrdntX1,intCrdntY1,intCrdntX2,intCrdntY2);
              else if (intShapeDecider == 1)
                   result = new Rectangle(intCrdntX1,intCrdntY1,intWidth,intHeight);
    else if (intShapeDecider == 2)
              result = new Ellipse2D.Double(intCrdntX1,intCrdntY1,intWidth,intHeight);
              return result;
         }

    Nope...don't think that's the problem. My random ints are only 3 possible nums ...0,1, or 2. I have an if for each possible condition. Therefore, nothing "else" can really happen. No?

  • Wwsto_api_session: problems on refresh

    Hi,
    I have a portlet [pl/sql based].
    In package of this portlet (procedure show) I am working with the session objects:
    1. Load the session object, using load_session method.
    2. Manipulate the attributes of the session object by using the set_attribute methods.
    3. Save session, using save_session method.
    Then I access the portlet for the first time.
    But on refresh page,which include the portlet, and procedure show of the portlet executes, the session variables are null.
    Please, help me!
    Sorry for my English, Sergei

    Hi!
    Addition to previous queston "wwsto_api_session: problems on refresh"
    Does anybody can help me?
    Oracle 9 iAS R2
    procedure show(...);
    declare
    l_session portal.wwsto_api_session;
    counter number ;
    begin
    l_session:=portal.wwsto_api_session.load_session('domain','subdomain');
    counter:=l_session.get_attribute_as_number('counter');
    htp.p('counter='||counter);
    counter:=counter+1;
    l_session.set_attribute('counter',counter);
    l_session.save_session;
    end;
    end;
    Text of the procedure got from books, oracle guides.
    What's wrong?
    Sergei.

  • Problem with installing free App (Everything is fine, bur we had a small problem getting your license)

    Hello,
    We have free App for SharePoint Online. Some our customers have problems with the installation. After install they see an issue with obtaining a license which should be free.
    "Everything is fine, bur we had a small problem getting your license. Please go back to the SharePoint store to get this app again and you won't be charget for it."
    See the screen:
    How can we resolve the issue?
    Thank you!
    Our App: "Resource Reservation"
    https://store.office.com/resource-reservation-WA104276770.aspx

    Hi Gabe,
    First, please check the suggestion above is helpful. I also suggest you removing all version of Office and re-install Office 2013.
    We can try to run the application as an administrator and check if it works.
     1. Right click the shortcut of the application or the main application.
     2. Select properties.
     3. Select compatibility tab and select "Run this program as an administrator."
    If there is anything I can do for you about this issue, don't hesitate to tell me.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Problem in refreshing

    Hi ,
    i am facing a problem of refreshing a query.
    my query is using a user inputn variable for fiscal yr and on the basis of fiscal year it return a variable say 01.04.2007-30.04.200 .
    but the problemm is wen i first enter the value of fiscal year in query it shows perfect data but as soon as i change the value of variable let say if i make it 2006 from 2007 it gives me the same data its not refreshing the data plz letme know y is it happning,
    thnks

    hi m refreshing it ..still
    WHEN 'ZC00000N25'. " variable
        LOOP AT i_t_var_range INTO loc_var_range
          WHERE vnam = '0P_FYEAR'. " fiscal variable
          CLEAR l_s_range.
          l_s_range-low(4) = loc_var_range-low(4) + 1  .
          l_s_range-low+4(4) = '0101'   .
          l_s_range-sign = 'I'.
          l_s_range-opt =  'BT'.
          l_s_range-high(4) = loc_var_range-low(4) + 1.
          l_s_range-high+4(4) = '0331'.
          APPEND l_s_range TO e_t_range.
           CLEAR : l_s_range , i_t_var_range.
          EXIT .
        ENDLOOP .

  • Problem of refreshing a tree in web dynpro java

    hi all,
    I'm facing a problem for refreshing a tree in web dynpro java for SAP HR.
    I created a viewset with 2 cells( 1 view for each).
    In the 1st view I created a droplistbyindex to select the unit ID and in the 2nd view ( defaut=false)  I called a method to populate my tree according to my selection in the 1st view ( method called in wdInit).
    When I make the first selection everything is ok.
    But when I select another unit ID, the tree is not changed and I know the context is well changed according to my selection.
    So I think the method is executed only the first the view is called.
    In this case, how can I refresh my tree on real-time?
    Thanks for your help
    Yimin

    May be u can write the code wdDoModify instead.
    -Ashutosh

  • Problem in refreshing popup

    ADF11g :
    I have problem in refreshing popup.
    On main page there is one table and in one column of that table i put commandImageLink .on click of that image i supposed to open one popup where i am displaying info result.
    on first click of that image i am able to show result correctly but if i change the row and try to click image again i am not able to show new result .it is showing old one.Onclick i checked new result values are retrived by server but not reflecting on popup.
    One more thing which i observerd is that at first time when i click image it goes to action method and then open popup but at next click it opens popup fisrt and then call action method.
    <af:column sortable="false" headerText="Actions"
    rendered="true" width="50">
    <af:panelGroupLayout layout="horizontal">
    <af:commandImageLink icon="/image/info.jpg"
    shortDesc="Info"
    partialSubmit="true" action="#{IssueActionBean.refresh_ContentRevisionInfo1}"
    launchListener="#{IssueActionBean.getRevisionLauncherListener}">
    <af:showPopupBehavior popupId="::popupinfo"
    triggerType="click"/>
    </af:commandImageLink>
    <af:commandImageLink icon="/image/checkinout.jpeg"
    shortDesc="Check in/out">
    <af:showPopupBehavior popupId="::popupMenu"
    triggerType="action"
    align="beforeStart"/>
    </af:commandImageLink>
    </af:panelGroupLayout>
    </af:column>
    </af:table>
    <af:popup id="popupinfo" popupFetchListener="#{IssueActionBean.getfetchRevisionLauncherListener}">
    <af:panelWindow title="Content Information"
    inlineStyle="width:600px; height:500px;">
    <af:table value="#{bindings.documentRevisions.collectionModel}"
    var="row" id="popupinfo1"
    rows="#{bindings.documentRevisions.rangeSize}"
    emptyText="#{bindings.documentRevisions.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.documentRevisions.rangeSize}"
    selectedRowKeys="#{bindings.documentRevisions.collectionModel.selectedRow}"
    selectionListener="#{bindings.documentRevisions.collectionModel.makeCurrent}"
    rowSelection="single"
    inlineStyle="width:750px; height:250px; margin:20px;">
    <af:column sortProperty="revLable" sortable="true"
    headerText="#{res['contentInformation.revision']}">
    <af:outputText value="#{row.revLable}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.documentRevisions.hints.revLable.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="releaseDate"
    sortable="true"
    headerText="#{res['contentInformation.rDate']}">
    <af:outputText value="#{row.releaseDate}">
    <af:convertDateTime pattern="#{bindings.documentRevisions.hints.releaseDate.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="expirationDate"
    sortable="true"
    headerText="#{res['contentInformation.eDate']}">
    <af:outputText value="#{row.expirationDate}">
    <af:convertDateTime pattern="#{bindings.documentRevisions.hints.expirationDate.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="status" sortable="true"
    headerText="#{res['contentInformation.status']}">
    <af:outputText value="#{row.status}"/>
    </af:column>
    <af:column sortProperty="did" sortable="true"
    headerText="#{ res['contentInformation.did']}">
    <af:outputText value="#{row.did}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.documentRevisions.hints.did.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="docName" sortable="true"
    headerText="#{res['contentInformation.docName']}">
    <af:goLink destination="#{row.docURL}" text="#{row.docName}"
    targetFrame="_blank"/>
    </af:column>
    <af:column sortProperty="docURL" sortable="true"
    headerText="#{bindings.documentRevisions.hints.docURL.label}">
    <af:outputText value="#{row.docURL}"/>
    </af:column>
    </af:table>
    <af:panelFormLayout>
    </af:panelFormLayout>
    </af:panelWindow>
    </af:popup>
    public String refresh_ContentRevisionInfo1() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("getContentRevisionInfo");
    Object result = operationBinding.execute();
    bindings.refresh();
    DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("documentRevisionsIterator");
    iterBind.executeQuery();
    iterBind.refresh(DCIteratorBinding.RANGESIZE_UNLIMITED);
    return null;
    public void getRevisionLauncherListener(LaunchEvent launchEvent) {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("getContentRevisionInfo");
    Object result = operationBinding.execute();
    bindings.refresh();
    DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("documentRevisionsIterator");
    iterBind.executeQuery();
    iterBind.refresh(DCIteratorBinding.RANGESIZE_UNLIMITED);
    Thanks for all Help.
    Jaydeep

    You are in the wrong forum. This is the the forum for the [Application Express development tool|http://apex.oracle.com]. You want a JDeveloper/ADF forum.

  • Console CatOS MOTD small problem

    Hello,
    I have a small problem when connecting to a console port.
    We make a connection via a terminalserver to the console port of a 6500 (Tacacs+). I like to have a banner before I login on CatOs. The problem with a MOTD is that only the banner is shown after a logout.
    Any suggestions?
    Greetings.
    Jeroen

    for some reason, this doesn't work for console access. It does work for direct telnet access.
    Maybe there is some problem with remote access via a terminalserver to the console port. Do i have to change something on the line (TTY) ports of the terminalserver?
    switch> (enable) set banner telnet ?
    disable Suppress the default Cisco Systems Console banner
    enable Display the default Cisco Systems Console banner

  • Many small problems in Mavericks

    When user experience many small problem in daily work, I feel the design is failed.
    Memory management has a lot of problem, I feel my macbook is abnormal slow after I upgraded to Mavericks. Sometime, I need to wait for several sec to get what I want.
    I think this problem is extreme important for OS.
    When I want to start a probelm, click once, no response, click twice, pop-up 2 times after 5 sec.
    Then i change my way of work, clock one time, work on other task. 5 sec later, multi desktop switch the desktop to the starting program. Then, I don't know what I was doing.
    Another is sound problem, sound doesn't work sometime and need some kind of procedure to get it back.
    Please don't ask me do something to solve the problem everytime when it happen. It is OS task to work it properly.
    Whatever how many great feature you added is meaningless if user daily experience is bad.

    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve your problem.
    2. If you don't already have a current backup, back up all data before doing anything else. The backup is necessary on general principle, not because of anything in the test procedure. There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    3. Below are instructions to run a UNIX shell script, a type of program. All it does is to gather information about the state of your computer. That information goes nowhere unless you choose to share it on this page. However, you should be cautious about running any kind of program (not just a shell script) at the request of a stranger on a public message board. If you have doubts, search this site for other discussions in which this procedure has been followed without any report of ill effects. If you can't satisfy yourself that the instructions are safe, don't follow them.
    Here's a summary of what you need to do, if you choose to proceed: Copy a line of text from this web page into the window of another application. Wait for the script to run. It usually takes a couple of minutes. Then paste the results, which will have been copied automatically, back into a reply on this page. The sequence is: copy, paste, wait, paste again. Details follow.
    4. You may have started the computer in "safe" mode. Preferably, these steps should be taken in “normal” mode. If the system is now in safe mode and works well enough in normal mode to run the test, restart as usual. If you can only test in safe mode, do that.
    5. If you have more than one user, and the one affected by the problem is not an administrator, then please run the test twice: once while logged in as the affected user, and once as an administrator. The results may be different. The user that is created automatically on a new computer when you start it for the first time is an administrator. If you can't log in as an administrator, test as the affected user. Most personal Macs have only one user, and in that case this section doesn’t apply.
    6. The script is a single long line, all of which must be selected. You can accomplish this easily by triple-clicking  anywhere in the line. The whole line will highlight, though you may not see all of it in your browser, and you can then copy it. If you try to select the line by dragging across the part you can see, you won't get all of it.
    Triple-click anywhere in the line of text below on this page to select it:
    PATH=/usr/bin:/bin:/usr/sbin:/sbin; clear; Fb='%s\n\t(%s)\n'; Fm='\n%s\n\n%s\n'; Fr='\nRAM details\n%s\n'; Fs='\n%s: %s\n'; Fu='user %s%%, system %s%%'; PB="/usr/libexec/PlistBuddy -c Print"; A () { [[ a -eq 0 ]]; }; M () { find -L "$d" -type f | while read f; do file -b "$f" | egrep -lq XML\|exec && echo $f; done; }; Pc () { o=`grep -v '^ *#' "$2"`; Pm "$1"; }; Pm () { [[ "$o" ]] && o=`sed '/^ *$/d; s/^ */   /' <<< "$o"` && printf "$Fm" "$1" "$o"; }; Pp () { o=`$PB "$2" | awk -F'= ' \/$3'/{print $2}'`; Pm "$1"; }; Ps () { o=`echo $o`; [[ ! "$o" =~ ^0?$ ]] && printf "$Fs" "$1" "$o"; }; R () { o=; [[ r -eq 0 ]]; }; SP () { system_profiler SP${1}DataType; }; id | grep -qw '80(admin)'; a=$?; A && sudo true; r=$?; t=`date +%s`; clear; { A || echo $'No admin access\n'; A && ! R && echo $'No root access\n'; SP Software | sed '8!d;s/^ *//'; o=`SP Hardware | awk '/Mem/{print $2}'`; o=$((o<4?o:0)); Ps "Total RAM (GB)"; o=`SP Memory | sed '1,5d; /[my].*:/d'`; [[ "$o" =~ s:\ [^O]|x([^08]||0[^2]8[^0]) ]] && printf "$Fr" "$o"; o=`SP Diagnostics | sed '5,6!d'`; [[ "$o" =~ Pass ]] || Pm "POST"; for b in Thunderbolt USB; do o=`SP $b | sed -En '1d; /:$/{s/ *:$//;x;s/\n//p;}; /^ *V.* [0N].* /{s/ 0x.... //;s/[()]//g;s/\(.*: \)\(.*\)/ \(\2\)/;H;}; /Apple|SCSM/{s/.//g;h;}'`; Pm $b; done; o=`pmset -g therm | sed 's/^.*C/C/'`; [[ "$o" =~ No\ th|pms ]] && o=; Pm "Thermal conditions"; o=`pmset -g sysload | grep -v :`; [[ "$o" =~ =\ [^GO] ]] || o=; Pm "System load advisory"; o=`nvram boot-args | awk '{$1=""; print}'`; Ps "boot-args"; d=(/ ""); D=(System User); E=; for i in 0 1; do o=`cd ${d[$i]}L*/L*/Dia* || continue; ls | while read f; do [[ "$f" =~ h$ ]] && grep -lq "^Thread c" "$f" && e=" *" || e=; awk -F_ '!/ag$/{$NF=a[split($NF,a,".")]; print $0 "'"$e"'"}' <<< "$f"; done | tail`; Pm "${D[$i]} diagnostics"; done; [[ "$o" =~ \*$ ]] && printf $'\n* Code injection\n'; o=`syslog -F bsd -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|last value [1-9]|n Cause: -|NVDA\(|pagin|SATA W|ssert|timed? ?o' | tail -n25 | awk '/:/{$4=""; $5=""};1'`; Pm "Kernel messages"; o=`df -m / | awk 'NR==2 {print $4}'`; o=$((o<5120?o:0)); Ps "Free space (MiB)"; o=$(($(vm_stat | awk '/eo/{sub("\\.",""); print $2}')/256)); o=$((o>=1024?o:0)); Ps "Pageouts (MiB)"; s=( `sar -u 1 10 | sed '$!d'` ); [[ s[4] -lt 85 ]] && o=`printf "$Fu" ${s[1]} ${s[3]}` || o=; Ps "Total CPU usage" && { s=(`ps acrx -o comm,ruid,%cpu | sed '2!d'`); o=${s[2]}%; Ps "CPU usage by process \"$s\" with UID ${s[1]}"; }; s=(`top -R -l1 -n1 -o prt -stats command,uid,prt | sed '$!d'`); s[2]=${s[2]%[+-]}; o=$((s[2]>=25000?s[2]:0)); Ps "Mach ports used by process \"$s\" with UID ${s[1]}"; o=`kextstat -kl | grep -v com\\.apple | cut -c53- | cut -d\< -f1`; Pm "Loaded extrinsic kernel extensions"; R && o=`sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|calendarse|cups|dove|isc|ntp|post[fg]|x)/{print $3}'`; Pm "Extrinsic system jobs"; o=`launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}'`; Pm "Extrinsic agents"; o=`for d in {/,}L*/Lau*; do M; done | grep -v com\.apple\.CSConfig | while read f; do ID=$($PB\ :Label "$f") || ID="No job label"; printf "$Fb" "$f" "$ID"; done`; Pm "launchd items"; o=`for d in /{S*/,}L*/Star*; do M; done`; Pm "Startup items"; o=`find -L /S*/L*/E* {/,}L*/{A*d,Compon,Ex,In,Keyb,Mail/B,P*P,Qu*T,Scripti,Servi,Spo}* -type d -name Contents -prune | while read d; do ID=$($PB\ :CFBundleIdentifier "$d/Info.plist") || ID="No bundle ID"; [[ "$ID" =~ ^com\.apple\.[^x]|Accusys|ArcMSR|ATTO|HDPro|HighPoint|driver\.stex|hp-fax|\.hpio|JMicron|microsoft\.MDI|print|SoftRAID ]] || printf "$Fb" "${d%/Contents}" "$ID"; done`; Pm "Extrinsic loadable bundles"; o=`find -L /u*/{,*/}lib -type f | while read f; do file -b "$f" | grep -qw shared && ! codesign -v "$f" && echo $f; done`; Pm "Unsigned shared libraries"; o=`for e in DYLD_INSERT_LIBRARIES DYLD_LIBRARY_PATH; do launchctl getenv $e; done`; Pm "Environment"; o=`find -L {,/u*/lo*}/e*/periodic -type f -mtime -10d`; Pm "Modified periodic scripts"; o=`scutil --proxy | grep Prox`; Pm "Proxies"; o=`scutil --dns | awk '/r\[0\] /{if ($NF !~ /^1(0|72\.(1[6-9]|2[0-9]|3[0-1])|92\.168)\./) print $NF; exit}'`; Ps "DNS"; R && o=`sudo profiles -P | grep : | wc -l`; Ps "Profiles"; f=auto_master; [[ `md5 -q /etc/$f` =~ ^b166 ]] || Pc $f /etc/$f; for f in fstab sysctl.conf crontab launchd.conf; do Pc $f /etc/$f; done; Pc "hosts" <(grep -v 'host *$' /etc/hosts); Pc "User launchd" ~/.launchd*; R && Pc "Root crontab" <(sudo crontab -l); Pc "User crontab" <(crontab -l); R && o=`sudo defaults read com.apple.loginwindow LoginHook`; Pm "Login hook"; Pp "Global login items" /L*/P*/loginw* Path; Pp "User login items" L*/P*/*loginit* Name; Pp "Safari extensions" L*/Saf*/*/E*.plist Bundle | sed -E 's/(\..*$|-[1-9])//g'; o=`find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) | wc -l`; Ps "Restricted user files"; cd; o=`SP Fonts | egrep "Valid: N|Duplicate: Y" | wc -l`; Ps "Font problems"; o=`find L*/{Con,Pref}* -type f ! -size 0 -name *.plist | while read f; do plutil -s "$f" >&- || echo $f; done`; Pm "Bad plists"; d=(Desktop L*/Keyc*); n=(20 7); for i in 0 1; do o=`find "${d[$i]}" -type f -maxdepth 1 | wc -l`; o=$((o<=n[$i]?0:o)); Ps "${d[$i]##*/} file count"; done; o=$((`date +%s`-t)); Ps "Elapsed time (s)"; } 2>/dev/null | pbcopy; exit 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    7. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign ($) or a percent sign (%). If you get the percent sign, enter
    exec bash
    in the window and press return. You should then get a new line ending in a dollar sign.
    Click anywhere in the Terminal window and paste (command-V). The text you pasted should vanish immediately. If it doesn't, press the return key.
    If you're logged in as an administrator, you'll be prompted for your login password. Nothing will be displayed when you type it. You will not see the usual dots in place of typed characters. Make sure caps lock is off. Type carefully and then press return. You may get a one-time warning to be careful. If you make three failed attempts to enter the password, the test will run anyway, but it will produce less information. In most cases, the difference is not important. If you don't know your password, or if you prefer not to enter it, just press return three times at the password prompt.
    If you're not logged in as an administrator, you won't be prompted for a password. The test will still run. It just won't do anything that requires administrator privileges.
    The test may take a few minutes to run, depending on how many files you have and the speed of the computer. A computer that's abnormally slow may take longer to run the test. While it's running, there will be nothing in the Terminal window and no indication of progress. Wait for the line "[Process completed]" to appear. If you don't see it within half an hour or so, the test probably won't complete in a reasonable time. In that case, close the Terminal window and report your results. No harm will be done.
    8. When the test is complete, quit Terminal. The results will have been copied to the Clipboard automatically. They are not shown in the Terminal window. Please don't copy anything from there. All you have to do is start a reply to this comment and then paste by pressing command-V again.
    If any private information, such as your name or email address, appears in the results, anonymize it before posting. Usually that won't be necessary.
    When you post the results, you might see the message, "You have included content in your post that is not permitted." It means that the forum software has misidentified something in the post as a violation of the rules. If it happens, please post the test results on Pastebin, then post a link here to the page you created.
    Note: This is a public forum, and others may give you advice based on the results of the test. They speak only for themselves, and I don't necessarily agree with them.
    Copyright © 2014 Linc Davis. As the sole author of this work, I reserve all rights to it except as provided in the Terms of Use of Apple Support Communities ("ASC"). Readers of ASC may copy it for their own personal use. Neither the whole nor any part may be redistributed.

Maybe you are looking for

  • At selection- screen output issue

    Hi, I have a issue regarding at selection-screen output event with radio buttons,  Fields are like, Block B1   RB1 Block B2 RB2    field 1 (Check box)    field 2 (Check box) User can select one radio button at a time. If the user clicks on radio butt

  • What is the use of factoring indicator in Business partners master data

    Hi All,         I am the biginner to SAP B1.please help me.I am creating the businee partners master data in that general tab factioring indicatior is there.what is need for that?

  • MM question

    I am looking through someone else's VBscript code for an ASP application and all of their variables have MM at the front of them. Examples: MM_UserAuthorization MM_UserID MM_dbTicket_STRING MM_Division Isn't that MM something that Dreamweaver automat

  • I have attempted to run Office 2010 Repair as Outlook will no longer open. When attempting to run Repair, it starts and stops saying in cannot locate file Office.en-us\dwdcw20.dll

    I did the disc error repair process under the disc Properties/tool menu. That did not make any difference.  I then downloaded the file dwdcw20.dll and put it into the Windows/system32 folder as instructed.  That made no difference.  When ever the Rep

  • Generic method

    Hi all, i have a question related to generic method in a non-generic class. the following code cannot be compiled. but I don't know why. public class G        void print(Integer i)           System.out.println("Inte");      void print(String s)