Why wont this Plist run at login?

typing this in manually in terminal works fine:
/opt/local/bin/daemondo --label=thin --start-cmd /usr/local/bin/thin start -s 3 -C /etc/thin/thin.yml --pid=none
I've tried loading the plist in both /Library/LaunchDaemons/ and ~/Library/LaunchAgents. (sudo launchctl load -w /paths/mentioned -- however I get launchctl: Dubious ownership on file (skipping) -- so I use sudo launchctl load -F for ~/Library/LaunchAgents/thin.plist).
Neither seem to work.
Here's the plist on pastebin.
http://pastebin.ca/922156
Please tell me what is wrong with it -- I'm losing my sanity.

if including these program arguments are giving you a headache, how about making a simple executable script (permissions 755) that reads
#!/bin/sh
/opt/local/bin/daemondo --label=thin --start-cmd /usr/local/bin/thin start -s 3 -C /etc/thin/thin.yml --pid=none
exit 0
then making your plist refer to the full path name to the above script, with no program arguments necessary?
See if manually launching the new script does what you want, then doublecheck that the script's permissions are 755 and that ownership and group affiliation are correct. The plist, as gnarlodius has said, should be 644.
Question: do you want this to run at system boot-up or reboot, or at user login? That determines in which LaunchDaemons or LaunchAgents directory that the plist belongs, as well as influence your choice of path to the script. Will also affect your choice of ownership and group affiliation or what user/group the plist should execute the script as.

Similar Messages

  • I have an ipod touch and now it doesnt sync properly. It gets to stage 1 of 3 of syncing( Which is 'backing up') Then it stops and itunes closes. Why wont this sync and what can I do about it?

    I have an ipod touch and now it doesnt sync properly. It gets to stage 1 of 3 of syncing( Which is 'backing up') Then it stops and itunes closes. Why wont this sync and what can I do about it?

    Hello,
    I am currently an owner of an Ipod Touch 4th generation. I see you are having problems with your Ipod Touch, so I will try to find a solution to your problem.
    Restart the Computer. This sometimes happens to me when I keep my Windows 7 on Sleep, and I try to sync my Ipod
    Make sure you have the latest version of Itunes
    Hope that helps!
    If none of the above solutions work, can you please respond back ASAP as I will try to find another solution to your problem (This might even help others with the same problem!)
    Cheers!
    Pizza98704

  • Why wont keychain access accept my login password

    a pop up window states "safari wants to use keychain log-in password,"
    but when i enter my log-in password it is invalid. why wont keychain
    accept password?

    When you get a request like that, the usual action you should take is to click on the "Allow" button.

  • Running iMac with Lion upgrade; why wont my keychain save website login info

    Hi,
    My safari only saves a few of the login info for website logins.  I am running latest lion.
    Thanks, Steve

    My autofill is properly set.  It seems like a majority are not remembered in key chain.  I am also running SplashId, but its not ready to use for autofill if I initiate outside of their program.
    Is there anyway around this?
    S

  • Why wont this RUN and Set a New-Service..?

    PS C:\WINDOWS\system32> New-Service -Name RunSafe -BinaryPathName C:\Users\3steveco33_01\Skydrive\Documents\Adminstartup.ps1
    -DisplayName 'Active Protraction Service' -Description Safety and Security -StartupType Manual -Credential 'Admin_01' -Depen
    New-Service-NameRunSafe-BinaryPathNameC:\Users\3steveco33_01\Skydrive\Documents\Adminstartup.ps1-DisplayName'*******
    ********** ******* '-DescriptionSafetyandSecurity-StartupTypeManual-Credential'Admin_01'-DependsOnSystem
    dsOn System
    New-Service : A positional parameter cannot be found that accepts argument 'and'.
    At line:1 char:1
    + New-Service -Name RunSafe -BinaryPathName C:\Users\3steveco33_01\Skydrive\Docume ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [New-Service], ParameterBindingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewServiceCommand
    As can be plainly seen here there is no positional paraaaaameter with the argument and as indicated in the error message...WTF
    s.mcknight
    As can be plainly seen here there is no positional paraaaaameter with the argument and as indicated in the error message...WTF It work yesterday...I deleted it last night with a successful operation message and today this....it is more than frustrating....I
    am clever, tenacious and persistent...and this one now has me stumped...!

    Hi S.mcknight,
    It seems you have solved this issue, if there is anything else regarding this iisue, please feel free to post back.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Why wont this Macro work with my custom watermarks, but finds the built-in building blocks from office 2010?

    Option Explicit
    Sub BatchProcess()
    Dim strFileName As String
    Dim strPath As String
    Dim oDoc As Document
    Dim oLog As Document
    Dim oRng As Range
    Dim oHeader As HeaderFooter
    Dim oSection As Section
    Dim fDialog As FileDialog
    Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
    With fDialog
        .Title = "Select folder and click OK"
        .AllowMultiSelect = False
        .InitialView = msoFileDialogViewList
        If .Show <> -1 Then
            MsgBox "Cancelled By User", , _
                   "List Folder Contents"
            Exit Sub
        End If
        strPath = fDialog.SelectedItems.Item(1)
        If Right(strPath, 1) <> "\" _
           Then strPath = strPath + "\"
    End With
    If Documents.Count > 0 Then
        Documents.Close savechanges:=wdPromptToSaveChanges
    End If
    Set oLog = Documents.Add
    If Left(strPath, 1) = Chr(34) Then
        strPath = Mid(strPath, 2, Len(strPath) - 2)
    End If
    strFileName = Dir$(strPath & "*.doc?")
    While Len(strFileName) <> 0
        WordBasic.DisableAutoMacros 1
        Set oDoc = Documents.Open(strPath & strFileName)
        'Do what you want with oDoc here
        For Each oSection In oDoc.Sections
            For Each oHeader In oSection.Headers
                If oHeader.Exists Then
                    Set oRng = oHeader.Range
                    oRng.Collapse wdCollapseStart
                    InsertMyBuildingBlock "ASAP 1", oRng
                End If
            Next oHeader
        Next oSection
        'record the name of the document processed
        oLog.Range.InsertAfter oDoc.FullName & vbCr
        oDoc.Close savechanges:=wdSaveChanges
        WordBasic.DisableAutoMacros 0
        strFileName = Dir$()
    Wend
    End Sub
    Function InsertMyBuildingBlock(BuildingBlockName As String, HeaderRange As Range)
    Dim oTemplate As Template
    Dim oAddin As AddIn
    Dim bFound As Boolean
    Dim i As Long
    bFound = False
    Templates.LoadBuildingBlocks
    For Each oTemplate In Templates
        If InStr(1, oTemplate.Name, "Building Blocks") > 0 Then Exit For
    Next
    For i = 1 To Templates(oTemplate.FullName).BuildingBlockEntries.Count
        If Templates(oTemplate.FullName).BuildingBlockEntries(i).Name = BuildingBlockName Then
            Templates(oTemplate.FullName).BuildingBlockEntries(BuildingBlockName).Insert _
                    Where:=HeaderRange, RichText:=True
            'set the found flag to true
            bFound = True
            'Clean up and stop looking
            Set oTemplate = Nothing
            Exit Function
        End If
    Next i
    If bFound = False Then        'so tell the user.
        MsgBox "Entry not found", vbInformation, "Building Block " _
                                                 & Chr(145) & BuildingBlockName & Chr(146)
    End If
    End Function
    This works, using the ASAP 1 watermark that is in bold. ASAP 1 is a built-in building block, if i just rename this to ASAP, but save it in the same place with buildingblocks.dotx it wont work. What do i need to do to be able to use this with my custom building
    blocks?

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Excel, this issue is related to Office DEV, please post the question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    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.

  • Questions, Extreme begginer - Why wont this work.

    /* My Java Program
    Failing To Compile 2009 - CurrentDate()
    /* Importing */
    import java.util.Scanner;
    import acm.graphics.*;
    import acm.program.*;
    class run {
         public static void main(String args[]){
         //Variables
         Scanner ninjatext = new Scanner(System.in);
         Scanner Clarinet_Request = new Scanner(System.in);
         System.out.println(ninjatext.nextLine());
         double pye, var1, ans;
         String yodawg;
         var1 = 2;
         pye = 3.14;
         yodawg ="I heard you like saxaphones  ";
         ans = var1/pye;
              System.out.println("Hello Cruel World?");
              System.out.print(yodawg);
              System.out.print("So i bought you ");
              System.out.print(ans);
              System.out.println(" Saxxes");
              System.out.println("So How many Clarinets Would you like????");
              System.out.println("Enter Number::");
              System.out.println("So " + Clarinet_Request.nextLine() + " Is how many clarinets You would like? Cool");
         /*Please end up working*/
         // Declaring Variables Semi-Randomly Works, Right?
         String test1 = "Ok i hope this works";
         int test2 = 10;
         double test3 = 4.9;
         int test4 = test2/test3; //Random Weird Awnser right???
         System.out.println(test2 + "Divided by" + test3 + "Is Equal To" + test4);
         /* This all should work, at least in theory.... But it wont right? */
         /** What have i gotten myself into? Oh well it sounds like it should work */
         Console console = System.console();
         String username = console.readLine("Lets Do This?: ");
         if (/* String? */username == "yes" || "Yes" || "YES"){
              testingthiscrap LeroyJenkins = new testingthiscrap
              LeroyJenkins.LetsDoThis()
         /* Guaranteed to not work */
    public class testingthiscrap extends GraphicsProgram {
         /** Runs the program */
         public void LetsDoThis() {
              GRect rect = new GRect(100, 50, 100, 100 / PHI);
              rect.setFilled(true);
              rect.setColor(Color.RED);
              add(rect);
              GOval oval = new GOval(150, 50 + 50 / PHI, 100, 100 / PHI);
              oval.setFilled(true);
              oval.setColor(Color.GREEN);
              add(oval);
    /** Constant representing the golden ratio */
         public static final double PHI = 1.618;
    /* Standard Java entry point */
    /* This method can be eliminated in most Java environments */
         public static void main(String[] args) {
              new FeltBoard().start(args);
         }//If anything i just typed i now feel heroic.
         // public static void
         Ok, sorry if the titles not good enough but i am a php programmer between begginer and intermediate but who wants to know java so i can say write a applet or something that can run from the desktop directly, also i wanted to lean OO and it in php confuses me infinately so i decided in the context of knowing nothing i might pick it up better thus java.
    So most of what im doing is confusing to me so i just tried to type some code (Well the first 20 maybe lines i compiled and tested but after that i couldnt test so i just ran with it. Today i tried to compile and poof, nothing.
    Any clues what im doing wrong and what i should do instead?
    BTW this stuff feels weird, i feel like to take imput it should have a html form or something. I dunno.
    also i dont even seem to have these acm packages im trying to import, any clue why?

    jman888 wrote:
    Ok, sorry if the titles not good enough but i am a php programmer between begginer and intermediate but who wants to know java so i can say write a applet or something that can run from the desktop directly, also i wanted to lean OO and it in php confuses me infinately so i decided in the context of knowing nothing i might pick it up better thus java. Ok?
    So most of what im doing is confusing to me so i just tried to type some code (Well the first 20 maybe lines i compiled and tested but after that i couldnt test so i just ran with it. Today i tried to compile and poof, nothing.I assume you got a compile time error, if so next time you post a question incorporate this piece of information.
    Any clues what im doing wrong and what i should do instead?I can take a stab at your code.
    BTW this stuff feels weird, i feel like to take imput it should have a html form or something. I dunno.One step at a time
    String yodawg;
    yodawg ="I heard you like saxaphones  ";This is not an error but plain weird IMHO, if you are declaring a variable then initializing it, you might as well do it all on one line.
    if (/* String? */username == "yes" || "Yes" || "YES"){
      testingthiscrap LeroyJenkins = new testingthiscrap
      LeroyJenkins.LetsDoThis()
    }This code will not compile and should produce one of possible many compiler errors. The condition inside the if statement requires each condition to be independent of one another. e.g. (username == "yes" || username = "Yes" || username == "YES").
    This also represents one of the most common errors presented to new comers. Equivalence of Objects such as Strings are compared using a method .equals() and not the term "==". The latter actually compares two Strings by the address stored in memory.
    class runBy convention all Class names begin with a capital letter
    Also it appears that the class run contains main method and an inner class in which itself contains a main method. I will conclude right here that you are biting off far more then you can chew. Start with the basics, e.g. Google for Java tutorials and start from "hello world" then make your way from there. Tackle one problem at a time and learn the concepts of the tutorial which will hopefully stay with you, as these fundamental concepts will be your foundation to development using the Java language.
    Mel
    Edited by: Melanie_Green, apparently CODE tags don't like me tonight

  • Why wont this post???????????????

    Using JSC2-1, deploying in appserver 8.2 or 9, INtell based system running windows XP
    I have an application that dynamically generates a grid within the session bean based on user input parameters.
    When I run the program within the IDE (appserver 8.2) the grid is displayed properly.
    When I deploy the program to either of the 8.2 or 9 appservers, the grid is not displayed.
    Can anyone explain why I can run program in IDE and it works correctly, but not in the appserver???
    What makes it even strangr, is I have three pages that display dynamic grids.
    All were copied from a separate probram and cloned to work in this environmment.
    Two of the three dynamically generated grids do not disoley when deployed, but one does. All three display in the development IDE (jsc2).
    How can this happen?
    I have another application that does basically the same thing and all dynamically generated grids perform the same in the IDE and on the server (Sun appserver 8.2).
    Any clue may be helpful.

      hopefully i can put this thread to bed flashed back to 1.e(1.14) and pc running ok with 16 gig og memory.i am not sure if it was the bios downgrade or the change of keyboard (msoft 3000 wired office) but i`m happy as larry again ,i only have one issue with the 1.14 bios and that is it dont like my m/soft sidewinder mouse as it only moves up and down but i have a replacement ready,,,,,,so thanks to all for all the patience in dealing with my problem and happy xmas to all

  • Why wont this jar execute (one way fine, the other is not)

    Without using a executable jar this works fine:
    java.exe -classpath myproject\classes;lib1.jar;lib2.jar;lib3.jar MyMainClass
    MyMainClass is my target class stored in myproject\classes
    I make an executable jar called Project.jar (basically all content in myproject\classes with usual manifest file containing target class) and then try
    java.exe -classpath lib1.jar;lib2.jar;lib3.jar -jar Project.jar
    This does not work and gives error:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/beans/factory/InitializingBean
    The class org/springframework/beans/factory/InitializingBean is contained in lib1.jar
    I must be missing something fundamental about creating executable jars?? Any ideas or pointers?

    I've simplified my problem so someone could help me please!!!!
    The following runs fine:
    java -cp .;Model.jar TestThe following fails:
    java -cp .;Model.jar -jar Test.jarException in thread "main" java.lang.NoClassDefFoundError: Model at Test.main(Test.java:8)
    Model.jar contains one class model.Model.class
    Test.jar contains one class Test.class plus manifest file. The Test class simple does the following:
    import model.Model;
    public class Test
      public static void main(String[] args)
        System.out.println("Start");
        Model model = new Model();
        System.out.println("End");   
    }Any ideas why?

  • Why wont this script work???

    Hi,
    I have previously used this script to make a portrait scroll bar which works perfectly, however i have altered the script to work in a landscape scroll bar by altering the x and y axis and switching out the height for width. However a part of it wont work...The left and right arrows work correctly however the scroll bar does not move and I can not for the life of me figure out why.
    Does anyone have any ideas as to what ive missed or done wrong?
    Thanks in advance
    scrolling = function () {
    var scrollWidth:Number = scrollTrack._width;
    var contentWidth:Number = contentMain._width;
    var scrollFaceWidth:Number = scrollFace._width;
    var maskWidth:Number = maskedView._width;
    var initPosition:Number = scrollFace._x=scrollTrack._x;
    var initContentPos:Number = contentMain._x;
    var finalContentPos:Number = maskWidth-contentWidth+initContentPos;
    var left:Number = scrollTrack._y;
    var top:Number = scrollTrack._x;
    var right:Number = scrollTrack._y;
    var bottom:Number = scrollTrack._width-scrollFaceWidth+scrollTrack._x;
    var dy:Number = 0;
    var speed:Number = 10;
    var moveVal:Number = (contentWidth-maskWidth)/(scrollWidth-scrollFaceWidth);
    scrollFace.onPress = function() {
      var currPos:Number = this._x;
      startDrag(this, false, left, top, right, bottom);
      this.onMouseMove = function() {
       dy = Math.abs(initPosition-this._x);
       contentMain._x = Math.round(dy*-1*moveVal+initContentPos);
    scrollFace.onMouseUp = function() {
      stopDrag();
      delete this.onMouseMove;
    btnUp.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x+speed<maskedView._x) {
        if (scrollFace._x<=top) {
         scrollFace._x = top;
        } else {
         scrollFace._x -= speed/moveVal;
        contentMain._x += speed;
       } else {
        scrollFace._x = top;
        contentMain._x = maskedView._x;
        delete this.onEnterFrame;
    btnUp.onDragOut = function() {
      delete this.onEnterFrame;
    btnUp.onRelease = function() {
      delete this.onEnterFrame;
    btnDown.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x-speed>finalContentPos) {
        if (scrollFace._x>=bottom) {
         scrollFace._x = bottom;
        } else {
         scrollFace._x += speed/moveVal;
        contentMain._x -= speed;
       } else {
        scrollFace._x = bottom;
        contentMain._x = finalContentPos;
        delete this.onEnterFrame;
    btnDown.onRelease = function() {
      delete this.onEnterFrame;
    btnDown.onDragOut = function() {
      delete this.onEnterFrame;
    if (contentWidth<maskWidth) {
      scrollFace._visible = false;
      btnUp.enabled = false;
      btnDown.enabled = false;
    } else {
      scrollFace._visible = true;
      btnUp.enabled = true;
      btnDown.enabled = true;
    scrolling();

    sorry should have said...its the aspect relating to "scrollFace" which is mentioned throughout..ive marked it out in bold and taken out anything unrelivant.
    Thanks
    So its:
    scrolling = function () {
    var scrollFaceWidth:Number = scrollFace._width;
    var initPosition:Number = scrollFace._x=scrollTrack._x;
    var bottom:Number = scrollTrack._width-scrollFaceWidth+scrollTrack._x;
    var moveVal:Number = (contentWidth-maskWidth)/(scrollWidth-scrollFaceWidth);
    scrollFace.onPress = function() {
      var currPos:Number = this._x;
      startDrag(this, false, left, top, right, bottom);
      this.onMouseMove = function() {
       dy = Math.abs(initPosition-this._x);
       contentMain._x = Math.round(dy*-1*moveVal+initContentPos);
    scrollFace.onMouseUp = function() {
      stopDrag();
      delete this.onMouseMove;
    btnUp.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x+speed<maskedView._x) {
       if (scrollFace._x<=top) {
         scrollFace._x = top;
        } else {
         scrollFace._x -= speed/moveVal;
        contentMain._x += speed;
       } else {
        scrollFace._x = top;
        contentMain._x = maskedView._x;
        delete this.onEnterFrame;
    btnDown.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x-speed>finalContentPos) {
       if (scrollFace._x>=bottom) {
         scrollFace._x = bottom;
        } else {
         scrollFace._x += speed/moveVal;
        contentMain._x -= speed;
       } else {
       scrollFace._x = bottom;
        contentMain._x = finalContentPos;
        delete this.onEnterFrame;
    if (contentWidth<maskWidth) {
      scrollFace._visible = false;
      btnUp.enabled = false;
      btnDown.enabled = false;
    } else {
      scrollFace._visible = true;
      btnUp.enabled = true;
      btnDown.enabled = true;

  • Why does this AppleScript run twice in Automator?

    I am trying to create an application that I can run and change the function of my F1, F2 keys to or from standard function. I found this AppleScript online and it works... but it runs twice in a row:
    tell application "System Preferences" to activate
    tell application "System Events"
    tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.keyboard"
    end tell
    tell process "System Preferences"
    click radio button "Keyboard" of tab group 1 of window "Keyboard"
    get every attribute of checkbox ¬
    "Use all F1, F2, etc. keys as standard function keys" of ¬
    tab group 1 of window "Keyboard"
    click checkbox ¬
    "Use all F1, F2, etc. keys as standard function keys" of ¬
    tab group 1 of window "Keyboard"
    activate
    if value of checkbox ¬
    "Use all F1, F2, etc. keys as standard function keys" of ¬
    tab group 1 of window "Keyboard" = 0 then
    display dialog ¬
    "Standard Function Keys off..." giving up after 1
    else
    display dialog ¬
    "Standard Function Keys on..." giving up after 1
    end if
    end tell
    tell application "System Preferences"
    quit
    end tell
    end tell
    If I change the Script by taking out the following, it only runs once. I believe my issue is in the below Script. I have fiddled with all that I know how to and either it doesn't run, or it runs twice...
    tell process "System Preferences"
    click radio button "Keyboard" of tab group 1 of window "Keyboard"
    get every attribute of checkbox ¬
    "Use all F1, F2, etc. keys as standard function keys" of ¬
    tab group 1 of window "Keyboard"
    click checkbox ¬
    "Use all F1, F2, etc. keys as standard function keys" of ¬
    tab group 1 of window "Keyboard"
    activate
    if value of checkbox ¬
    "Use all F1, F2, etc. keys as standard function keys" of ¬
    tab group 1 of window "Keyboard" = 0 then
    display dialog ¬
    "Standard Function Keys off..." giving up after 1
    else
    display dialog ¬
    "Standard Function Keys on..." giving up after 1
    end if
    end tell
    Any suggestions would help. If you run it and it only runs once, I am at a loss. Thank you for you time.

    it works fine for me in both automator and applescript. are you sure you didn't enter it twice in the Run Applescript workflow?
    a couple of tweaks, more for clarity than anything else:
              tell application "System Preferences"
                        activate
                        set current pane to pane "com.apple.preference.keyboard"
              end tell
              tell application "System Events"
                        tell process "System Preferences"
                                  click radio button "Keyboard" of tab group 1 of window "Keyboard"
                                  get every attribute of checkbox ¬
                                            "Use all F1, F2, etc. keys as standard function keys" of ¬
                                            tab group 1 of window "Keyboard"
                                  click checkbox ¬
                                            "Use all F1, F2, etc. keys as standard function keys" of ¬
                                            tab group 1 of window "Keyboard"
                                  activate
                                  if value of checkbox ¬
                                            "Use all F1, F2, etc. keys as standard function keys" of ¬
                                            tab group 1 of window "Keyboard" = 0 then
                                            display dialog ¬
                                                      "Standard Function Keys off..." giving up after 1
                                  else
                                            display dialog ¬
                                                      "Standard Function Keys on..." giving up after 1
                                  end if
                        end tell
                        tell application "System Preferences"
                                  quit
                        end tell
              end tell

  • Why wont this work as an applet??

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.SQLException;
    import java.applet.*;
    * This class creates a Swing GUI that allows the user to enter a SQL query.
    * It then obtains a ResultSetTableModel for the query and uses it to display
    * the results of the query in a scrolling JTable component.
    public class QueryFrame extends JApplet {
    ResultSetTableModelFactory factory; // A factory to obtain our table data
    JTextField query; // A field to enter a query in
    JTable table; // The table for displaying data
    JLabel msgline; // For displaying messages
    public void init(ResultSetTableModelFactory f) {
         this.factory = f;
         // Create the Swing components we'll be using
         query = new JTextField(); // Lets the user enter a query
         table = new JTable(); // Displays the table
         msgline = new JLabel(); // Displays messages
         // Place the components within this window
         Container contentPane = getContentPane();
         contentPane.add(query, BorderLayout.NORTH);
         contentPane.add(new JScrollPane(table), BorderLayout.CENTER);
         contentPane.add(msgline, BorderLayout.SOUTH);
         // Now hook up the JTextField so that when the user types a query
         // and hits ENTER, the query results get displayed in the JTable
         query.addActionListener(new ActionListener() {
              // This method is invoked when the user hits ENTER in the field
              public void actionPerformed(ActionEvent e) {
              // Get the user's query and pass to displayQueryResults()
              displayQueryResults(query.getText());
    * This method uses the supplied SQL query string, and the
    * ResultSetTableModelFactory object to create a TableModel that holds
    * the results of the database query. It passes that TableModel to the
    * JTable component for display.
    public void displayQueryResults(final String q) {
         // It may take a while to get the results, so give the user some
         // immediate feedback that their query was accepted.
         msgline.setText("Contacting database...");
         // In order to allow the feedback message to be displayed, we don't
         // run the query directly, but instead place it on the event queue
         // to be run after all pending events and redisplays are done.
         EventQueue.invokeLater(new Runnable() {
              public void run() {
              try {
                   table.setModel(factory.getResultSetTableModel(q));
                   msgline.setText(" ");
              catch (SQLException ex) {
                   // If something goes wrong, clear the message line
                   msgline.setText(" ");
                   // Then display the error in a dialog box
                   JOptionPane.showMessageDialog(QueryFrame.this,
                   new String[] {  // Display a 2-line message
                        ex.getClass().getName() + ": ",
                        ex.getMessage()
    public static void main(String args[]) throws Exception {
         // Create the factory object that holds the database connection using
         // the data specified on the command line
         ResultSetTableModelFactory factory =
    new ResultSetTableModelFactory("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:InvoiceExpress_Metso", "sa", "Imagon");
         // Create a QueryFrame component that uses the factory object.
         QueryFrame qf = new QueryFrame(factory);
         // Set the size of the QueryFrame, then pop it up
         //qf.setSize(500, 600);
         //qf.setVisible(true);
    }

    It won't, you have the main method, u have an application in the making, to turn it to an applet do the following:
    1- remove the Main method
    2- add init() method
    Thanks

  • Why wont this print good info?

    Can someone explain to me why this output doesn't print correctly? Is it because I am crossing classes or something?
    Output:
    Cup@82ba41Cup@923e30Cup@130c19bCup@1f6a7b9Cup@7d772eCup@11b86e7Cup@35ce36Cup@757aefCup@d9f9c3Cup@9cab16
    BUILD SUCCESSFUL (total time: 0 seconds)
    * Cup.java
    * Created on May 23, 2007, 10:12 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    * @author Pete Berardi
    public class Cup {
        private String cupSize;
        private String cupMaterial;
        public static final int LARGE = 1;
        public static final int SMALL = 0;
        public static final int PAPER = 2;
        public static final int PLASTIC =3;
        private int sizeCode;
        private int materialCode;
        /** Creates a new instance of Cup */
       public Cup(String cupSize, String cupMaterial){
       this. cupSize = cupSize;
       this.cupMaterial = cupMaterial;
       if(cupSize.equals("large"))
          sizeCode = LARGE;
       else
          sizeCode = SMALL;
       if(cupMaterial.equals("plastic"))
           materialCode = PLASTIC;
       else materialCode = PAPER;
    }

    something like this gives me decent output
    public String toString()
             return      "Cup Size      : "+cupSize+"\n"+
                       "Size Code     : "+sizeCode+"\n"+
                       "Cup Material  : "+cupMaterial+"\n"+
                       "Material Code : "+materialCode+"\n";
        }

  • Why wont this work??

    ive downloaded garage band, but when i try to open it it says i have no valid instrument library folder.... am i supposed to make one? why dont i have one?

    Which os system do you have? Garage Band is part of the iLife package and came preinstalled on Mac when Tiger first came out. The application GB package is on the system disc that comes with all Macs. Where did you download it from?

  • Why wont this update??Microsoft SQL Server 2005 Express Edition Service Pack 3 (KB955706)

    Everytime windows update downloads this it fails.
    Solved!
    Go to Solution.

    Download for SQL express SP3
    Cheers and regards,
    • » νιנαソѕαяα∂нι ѕαмανє∂αм ™ « •
    ●๋•کáŕádhí'ک díáŕý ツ
    I am a volunteer here. I don't work for Lenovo

Maybe you are looking for

  • I am Having a Nightmare!!

    Hi I would really appreciate some help! I just got a new 5th gen black 30GB ipod yesterday and I am having major issues trying to get it to work. I have an ipod mini and so all my updates where completely up to date and so I connected this new ipod t

  • Boot Camp Assistant restarts my computer but doesn't install windows

    Boot ROM Version: MBP31.0070.B02 SMC Version: 1.16f8 I'm trying to get windows xp home edition to install. I partition my drive, I put windows XP in, I tell it to install. It reboots, it spits xp out, and it boots up in OS X like normal. No installat

  • Ipod locking up continuously

    Hi I had to restore my ipod a couple of weeks ago because it wouldn't sync to iTunes. It was working fine until friday where it started to lockup when changing songs, so Im clicking next and its just not changing song, the current song stays playing.

  • How to calculate the frequency of the search string in a row

    Hi, I would like to find the frequency of the number of the occurences of a search string in a row which is of type of xmltype content. For ex: I would like to find the frequency of the word "oracle" in a row which is of type xmltype content. Is ther

  • Generate Report in fiori application

    Hi friends, i create a fiori application with sap web ide and i want to generate report with my data and export it. Could some one please help me Best Regards, Ameni,