Very Basic GUI Question

Can anyone tell me why this GUI won't display at all? Thanks
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;  //For colors
import java.awt.event.*;
public class Baseball extends JFrame {
public Baseball(){
    setTitle("Baseball!");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
   getContentPane().add(panel,BorderLayout.CENTER);
   panel.setBackground(Color.BLUE);
    setSize(400, 400);
    pack();
    setVisible(true);
     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here
       java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Baseball();
}I have no idea what this means: java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() Edited by: Champachikla on Feb 7, 2010 2:01 AM

Dan_Koldyr wrote:
1. avoid pack();/setVisible(true); directly in frame constructor But do not neglect to call pack() at some stage before setVisible(true).
2. invokeLater in main method makes no sense.It does in rare circumstances. (E.G. one visible app. calling the main of another app.)
So i would suggest modify your code like following
public Baseball(){
setSize(400, 400);
No. The previous poster got it right when talking about setting the preferred size. After pack(), your GUI will be shrunk as well.

Similar Messages

  • Very Basic Functions Question

    Hi,
    apologies for this being a very basic question, but I rarely
    use Flash. About once a year, however, I am called upon to do some
    sort of (usually very simple) Flash-based project for the students
    I assist. This time it's a simple random slideshow.
    The setup is this:
    * I have a movieClip called 'slides_MC' containing all the
    slide photos, on consecutive frames.
    * This movieClip is placed inside another movieclip named
    slideshowRand_MC.
    This is given an instance name of topslide_mc, and faded up
    and down with alpha keyframes.
    The idea is that, when the slides mc is faded right down,
    some Actionscript causes the slides movie to jump to, and stop
    playing on a random frame, so random slides are faded up, then down
    again, then swapped.
    I need to apply some actionscript to particular keyframes so
    that the swap is performed at the correct time.
    This is my attempt at a reusable function to do the swapping.
    It's placed in a keyframe on the root timeline:
    // Go to and stop at random frame in slides movieclip
    function goRandom(mc) {
    // Number of slides in slides movieclip
    var slides = 22;
    // Random number between 1 and number of frames in slides
    movieclip
    var randFrame = Math.ceil(Math.random() * slides);
    mc.goToAndStop("slide_" & randFrame);
    This function is called from keyframes in slideshowRand_MC:
    _root.goRandom(this.slideshow_rand_mc.topslide_mc);
    I know this is really basic stuff, but can anyone tell me why
    this isn't working.
    I've tried adding a breakpoint in the goRandom function, but
    it doesn't look like it ever gets called.
    Any assistance very gratefully accepted.
    Alex

    Hi Bob, thanks for getting back to me.
    quote:
    Originally posted by:
    Bob Pierce
    "_root.goRandom(this.slideshow_rand_mc.topslide_mc);"
    There's a typo in that line - if it's in your code, it won't
    work!
    Ah, true. The typo actually happened when I was re-writing
    the code in post. The actual code in the movie is
    _root.goRandom(this.topslide_mc);
    This is attached to a keyframe of the container movie-clip
    containing the slides MC.
    I've put the fla file on our server.
    slideshow_random.fla.zip
    If you, or someone else could download it and help me find
    out what I'm doing wrong, I'd be ever-so grateful. I'm sure it's
    something really obvious. Without being very familiar with Flash
    and Actionscript, it's hard to explain things, and much easier to
    show you the actual Flash file.
    The 2 functions are on a keyframe on frame 1 of the root
    timeline. The 'goRandom' function is supposed to be called from a
    keyframe in 'slideshowRand_MC'. I envisaged calling the random
    pause function from another keyframe in the same movieclip.
    Thanks again,
    Alex

  • Very basic loop question

    Hi everyone, I´m somewhat new with programming and I have a very basic loop problem, that I can´t solve.
    I have 3 ArrayLists:
    A has the project information, ordered by client, identified by a projectId, clientId and businessId
    B has the client information, ordered by business, identified by a clientId and businessId
    C has the business information, identified by a businessId.
    I need to show all the projects of a client, then the client information of a certain business, and at last the business information in a format like this:
    A -- Project1
    A -- Project2
    A -- Project3
    B -- Client1
    A -- Project4
    A -- Project 5
    A -- Project 6
    B -- Client2
    C -- Business1
    A -- Project7
    A -- Project8
    B -- Client3
    A -- Project9
    B -- Client4
    C -- Business2
    How should I program my loops? I've been trying different ways but everytime it doesn't print what I want. Help, please!

    OK, here's my code:
    for(int bussCounter= 0; bussCounter< bussArray.size(); bussCounter++)
       ValueObject bussVO = bussArray.get(bussCounter);
       String bussId = bussVO.getBussId();
       for (int clieCounter = 0; clieCounter < clieArray.size(); clieCounter++)
          ValueObject clieVO = clieArray.get(clieCounter);
          String clieId = clieVO.getClieId();
          String bussIdClie = clieVO.getBussId();
             for (int projCounter = 0; projCounter < projArray.size(); projCounter++)
                ValueObject projVO = projArray.get(projCounter );
                String clieIdProj = projVO .getClieId();
                String bussIdProy = projVO .getBussd();
                if (clieIdProy == clieId && bussIdProy == BussIdClie)
                   out.println("<tr>");
                   out.println("<td>" + projVO .getBussId() + "</td>");
                   out.println("<td>" + projVO .getClieId() + "</td>");
                   out.println("<td>" + projVO .getProjId() + "</td>");
                  out.println("<td>" + projVO .getTotal() + "</td>");
                  out.println("</tr>");
              if (bussIdClie == bussId)
                 out.println("<tr>");
                 out.println("<td>" + clieVO .getBussId() + "</td>");
                 out.println("<td>" + clieVO .getClieId() + "</td>");
                 out.println("<td>" + clieVO .getTotal() + "</td>");
                 out.println("</tr>");
       out.println("<tr>");
       out.println("<td>" + bussVO .getBussId() + "</td>");
       out.println("<td>" + projVO .getTotal() + "</td>");
       out.println("</tr>");
    }

  • Very Basic Flash question

    I apologize for this, but I can't seem to figure out this
    very basic function:
    I select a certian number of frames and I'd like to see at a
    glance how many frames I have selected. if I select 42 frames is
    there somewhere I can look that tells me I have 42 frames selected?
    Thanks,
    D.

    Quickest way to do this is to select the amount of frames you
    want in the timeline then hit F6 on your keyboard to turn them all
    into keyframes. Now if you look at the toolbar below it (where the
    frames per second(fps), onion skinning, etc) you will see the
    Current Frame displayed.
    Undo to get rid of the keyframes

  • Very basic Balance question

    Hi, as I said in the title, this is very basic. How can I set the pan on a stereo track to 9:15 or anything other than full left/right?
    Thank you.

    Thanks. Let me see if you got it right. When I have a stereo track and I move the pan knob to left, at at 9 o'clock, is the right channel moving in the same exact opposite direction (:15) so I have a narrower stereo panning?
    Or to do this I need what Bee Jay said?
    Thanks.

  • Very Basic actionscript question

    Hi,
    This is very basic but for some reason cant get it to work.
    Basically I have a movie that plays and at the end I have a button that comes on screen but once the button stops I want the user to press the button then it goes to the url.
    I have
    stop() {
    on (release) {
            getURL("http://google.co.uk","_self","blank");
    but this doesnt work.
    Thankyou for any help.

    I have now sorted it, I had my movie on actionscript 3 and needed to put the url code onto the actual button.

  • Help with a very basic GUI

    Hi guys, i have a project to do and Ive chosen hangman. Ive already made the main program , but i need help with the GUI. I havent been taught about GUI in school, so all i know is what i could understand from a book and what ive read on the internet..
    First , heres the code of my basic Hangman class:
    import java.io.*;
    import java.util.Random;
    public class Hangman
        public void maingame()throws IOException
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String movies[]={"THE BOURNE ULTIMATUM","TRANSFORMERS","RUSH HOUR 3","THE INSIDE MAN","THE SIMPSONS MOVIE","THE LORD OF THE RINGS","DIE HARD 4.0"};
            Random rand = new Random();
            char current[]=(movies[rand.nextInt(movies.length)]).toCharArray();  //Convert a random string from movies array into a char array
            char actual[]=new char[current.length]; //Store current state of guessed movie
            for (int i=0;i<actual.length;i++)
                if (isVowel(Character.toUpperCase(current))==true)
    actual[i]=current[i];
    else if (isSpecialChar(Character.toUpperCase(current[i]))==true)
    actual[i]=current[i];
    else if (current[i]==' ')
    actual[i]='/';
    else
    actual[i]='_';
    String hangman = "HANGMAN";
    int turnsleft=7;
    StringBuffer guessed=new StringBuffer();
    while (turnsleft!=0)
    System.out.println("\n\t\t\t\t"+hangman.substring(0,turnsleft)+"\n");
    print(actual);
    System.out.println("\nEnter your guess");
    String inp = br.readLine();
    if (inp.length()>1)
    System.out.println("You may only enter one character");
    else
    char guess = inp.charAt(0); //Convert the entered string to char
    if ( (hasBeenGuessed(guess,guessed)) == true )
    System.out.println("You have already guessed that\nYou have "+turnsleft+" turns left");
    else if (guess >= '0' && guess <= '9')
    System.out.println("You cannot guess digits.All digits in a movie will will be filled in automatically");
    else
    guessed.append(guess);
    if (isVowel(guess)!=true)
    if (isCorrect(guess,turnsleft,current,actual)==true)
    if (hasWon(actual,current)==true)
    System.out.println();
    print(actual);
    System.out.println("\nCongratulations!You won!");
    System.exit(0);
    else
    System.out.println("\nCorrect Guess!\nYou have "+turnsleft+" turns left\n");
    else
    turnsleft--;
    System.out.println("Wrong Guess!\nYou have "+turnsleft+" turns left\n");
    else if (isVowel(guess)==true)
    System.out.println("You cannot guess vowels\nYou have "+turnsleft+" turns left\n");
    else
    System.out.println("You have already guessed that\nYou have "+turnsleft+" turns left\n");
    print(actual);
    if (turnsleft==0)
    System.out.println("\nYou lose!\nThe movie was: ");
    print(current);
    System.exit(0);
    private boolean isCorrect(char guess,int turnsleft,char current[],char actual[])
    int flag=0;
    for (int i=0;i<current.length;i++)
    if ( Character.toUpperCase(current[i])==Character.toUpperCase(guess) && actual[i]!=guess ) //Check if guess is correct, and make sure it has not already been entered
    actual[i]=guess;
    flag=1;
    else if (Character.toUpperCase(current[i])!=Character.toUpperCase(guess) && i==current.length-1 && flag==0)
    return false;
    if (flag!=0)
    return true;
    else
    return false;
    private boolean hasWon(char actual[],char current[])
    char actualspc[]=new char[actual.length];
    for (int i=0;i<actual.length;i++)
    if (actual[i]=='/')
    actualspc[i]=' ';
    else
    actualspc[i]=actual[i];
    for (int i=0;i<actual.length;i++)
    if ((Character.toUpperCase(current[i]))==(Character.toUpperCase(actualspc[i])) && i==actual.length-1)
    return true;
    else if ((Character.toUpperCase(current[i]))==(Character.toUpperCase(actualspc[i])) && i!=actual.length-1)
    continue;
    else
    return false;
    return false;
    private void print(char arr[])
    for (int i=0;i<arr.length;i++)
    System.out.print(Character.toUpperCase(arr[i])+" ");
    private boolean isVowel(char a)
    if (a=='a' || a=='A' || a=='e' || a=='E' || a=='i' || a=='I' || a=='o' || a=='O' || a=='u' || a=='U')
    return true;
    else
    return false;
    private boolean isSpecialChar(char a)
    //if (a>='a' && a<='z')
    //return false;
    //else if (a>='A' && a<='z')
    //return false;
    //else if (a==' ')
    //return false;
    //else if (a>='0' && a<='9')
    //return true;
    if (isLetter(a)==true)
    return false;
    else if (isWhiteSpace(a)==true)
    return false;
    else if (isDigit(a)==true)
    return true;
    else
    return true;
    private boolean hasBeenGuessed(char a,StringBuffer guessed)
    for (int i=0;i<guessed.length();i++)
    if ( Character.toUpperCase(guessed.charAt(i)) == Character.toUpperCase(a))
    return true;
    return false;
    My first 2 questions are here:
    a - Why does isLetter not work, it says cannot resolve symbol - method isLetter(char)... Im guessing even isDigit and isWhiteSpace wont work, so why? If i cant use them ill have to use the commented code, its kind of unprofessional..
    b- Isnt there any way i can compare chars ignoring cases besides converting both to one case, like im doing now?
    Heres the new HangmanGUI class i made, it doesnt necessarily have to be a different class in the final outcome, but i would prefer it if it can.. Ive made what i can figure out.. Ive commented about what i need to do.
    Keep in mind i cant use Applets, only Frame/JFrame
    import java.awt.*;
    import javax.swing.*;
    public class HangmanGUI extends JFrame implements ActionListener
        Button newGame = new Button("New Game");
        Button entGuess = new Button("Submit Guess");
        Button giveUp = new Button("Give Up");
        TextField input = new TextField("",1);
        Label hangman = new Label("HANGMAN");
        JPanel play = new JPanel();
        JPanel hang = new Jpanel();
        GridLayout playLayout = new GridLayout(2,4);
        public HangmanGUI()
            play.setLayout(playLayout);
            play.add(hangman+"\n");
            play.add(newGame);
            play.add(giveUp);
            play.add(input);
            play.add(entGuess);
            hang.add(hangman);
            getContentPane().add(play);
            getContentPane().add(hang);
        public void ActionPerformed(ActionEvent act)
            Object src = act.getSource();
            if (src==newGame)
            main(); //Calling main to restart program - will that work?
            //if (src==entGuess)
            //Need to submit the guess, while input is not empty to Hangman class
            //if (src==giveUp)
            //Need to go into the losing part of Hangman class
    }As you can see i need help with:
    a - How to complete the other ifs
    b - How to really use the data of my Hangman class in this class and combine the GUI and backend to make a nice GUI Hangman app
    c - btw, right now if i try to compile HangmanGUI it highlights the implements ActionListener line and says cannot resolve symbol - class ActionListener..
    Any help would be greatly appreciated

    Thanks for the explanation pete...
    Anyways, i started implementing my code within abillconsl's code, and im trying to assign a label to a char array using .toString(); but instead of whats in the char array i get [C@<numbers and digits> ..
    Whats wrong?
    [code]
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Random;
    public class HangEmHighGUI extends JFrame implements ActionListener
    private Button newGame,
    entGuess,
    giveUp;
    private TextField input;
    private Label hangman,
    movie;
    private JPanel play,
    hang;
    private GridLayout playLayout;
    private FlowLayout labelLayout;
    private Container container; // To avoid extra meth calls
    String movies[]={"THE/BOURNE/ULTIMATUM","TRANSFORMERS","RUSH HOUR 3","THE INSIDE MAN","THE SIMPSONS MOVIE","THE LORD OF THE RINGS","DIE HARD 4.0"};
    Random rand = new Random();
    char current[]=(movies[rand.nextInt(movies.length)]).toCharArray(); //Convert a random string from movies array into a char array
    char actual[]=new char[current.length]; //Store current state of guessed movie
    public HangEmHighGUI()
    setUp();
    container = this.getContentPane();
    play = new JPanel();
    hang = new JPanel();
    playLayout = new GridLayout(1, 3, 5, 5); // rows, cols, space, space
    labelLayout = new FlowLayout(FlowLayout.CENTER);
    newGame = new Button("New Game");
    entGuess = new Button("Submit Guess");
    giveUp = new Button("Give Up");
    input = new TextField("",1);
    hangman = new Label("HANGMAN");
    movie = new Label(actual.toString());
    hang.setLayout(labelLayout);
    play.setLayout(playLayout);
    play.add(newGame);
    play.add(giveUp);
    play.add(entGuess);
    hang.add(hangman);
    hang.add(movie);
    container.add(hang,BorderLayout.NORTH);
    container.add(input,BorderLayout.CENTER);
    container.add(play,BorderLayout.SOUTH);
    pack();
    setVisible(true);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    public void actionPerformed(ActionEvent act)
    Object src = act.getSource();
    if (src==newGame)
    main(new String[] {""}); //Calling main to restart program, this does not work without parameters, is there some other way to restart?
    if (src==entGuess)
    if (input.getText()=="")
    setUp();
    //if (src==giveUp)
    //Need to go into the losing part of Hangman class
    public static void main(String args[])
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    new HangEmHighGUI();
    private void setUp()
    for (int i=0;i<actual.length;i++)
    if (isVowel(Character.toUpperCase(current)))
    actual[i]=current[i];
    else if (isSpecialChar(Character.toUpperCase(current[i])))
    actual[i]=current[i];
    else if (Character.isWhitespace(current[i]))
    actual[i]='/';
    else
    actual[i]='_';
    private boolean isVowel(char a)
    if (Character.toUpperCase(a)=='A' || Character.toUpperCase(a)=='E' || Character.toUpperCase(a)=='I' || Character.toUpperCase(a)=='O' || Character.toUpperCase(a)=='U')
    return true;
    else
    return false;
    private boolean isSpecialChar(char a)
    if (Character.isLetter(a))
    return false;
    else if (Character.isDigit(a))
    return true;
    else if (Character.isWhitespace(a))
    return false;
    else
    return true;
    private boolean isCorrect(char guess,int turnsleft,char current[],char actual[])
    int flag=0;
    for (int i=0;i<current.length;i++)
    if ( Character.toUpperCase(current[i])==Character.toUpperCase(guess) && actual[i]!=guess ) //Check if guess is correct, and make sure it has not already been entered
    actual[i]=guess;
    flag=1;
    else if (Character.toUpperCase(current[i])!=Character.toUpperCase(guess) && i==current.length-1 && flag==0)
    return false;
    if (flag!=0)
    return true;
    else
    return false;
    private boolean hasWon(char actual[],char current[])
    char actualspc[]=new char[actual.length];
    for (int i=0;i<actual.length;i++)
    if (actual[i]=='/')
    actualspc[i]=' ';
    else
    actualspc[i]=actual[i];
    for (int i=0;i<actual.length;i++)
    if ((Character.toUpperCase(current[i]))==(Character.toUpperCase(actualspc[i])) && i==actual.length-1)
    return true;
    else if ((Character.toUpperCase(current[i]))==(Character.toUpperCase(actualspc[i])) && i!=actual.length-1)
    continue;
    else
    return false;
    return false;
    private void print(char arr[])
    for (int i=0;i<arr.length;i++)
    System.out.print(Character.toUpperCase(arr[i])+" ");
    private boolean hasBeenGuessed(char a,StringBuffer guessed)
    for (int i=0;i<guessed.length();i++)
    if ( Character.toUpperCase(guessed.charAt(i)) == Character.toUpperCase(a))
    return true;
    return false;
    Note that the majority of the code has been taken from my old hangman class, i havent adapted it to the GUI yet, so ignore all of that stuff.

  • Very basic code questions

    Hi,
    I'm pretty new to dealing with this so please bare with me. I come from a PHP background so I got alot to learn here ;) Anyway, to my question then. I've got a book that im reading and following examples from but also try to evolve those examples into something more, to try and learn even more. I haven't come very far yet but I've stumbled across a little thing that I woulld like some help with. I'll post the complete code just in case.
    import java.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.wireless.messaging.*;
    import javax.microedition.io.*;
    public class quiz
         extends MIDlet
         implements CommandListener {
      private List mList, longList;
      private Command mExitCommand, mNextCommand, longExitCommand, longNextCommand;
      public quiz() {
        String[] stringElements = { " Game 1", " Game 2", " Game 3", " Game 4", " Game 5", " Game 6", " Game 7", " Game 8" };
        Image[] imageElements = { loadImage("/1.png"),
         loadImage("/2.png"),
         loadImage("/3.png"),
         loadImage("/4.png"),      
         loadImage("/5.png"),
         loadImage("/6.png"),
         loadImage("/7.png"),
         loadImage("/8.png") };
        mList = new List("Quiz v1.0", List.IMPLICIT, stringElements, imageElements);
        mNextCommand = new Command("Choose", Command.SCREEN, 0);
        mExitCommand = new Command("Exit", Command.EXIT, 0);
        mList.addCommand(mNextCommand);
        mList.addCommand(mExitCommand);
        mList.setCommandListener(this);
      void HowMany() {
        String[] stringElements = { " 1 question", " 2 questions", " 3 questions", " 4 questions", " 5 questions" };
        longList = new List("Quiz v1.0", List.EXCLUSIVE, stringElements, null);
        longNextCommand = new Command("V�lj", Command.SCREEN, 0);
        longExitCommand = new Command("Avsluta", Command.EXIT, 0);
        longList.addCommand(longNextCommand);
        longList.addCommand(longExitCommand);
        longList.setCommandListener(this);
      public void startApp() {
        Display.getDisplay(this).setCurrent(mList);
      public void commandAction(Command c, Displayable s) {
        if (c == mNextCommand || c == List.SELECT_COMMAND) {
          int index = mList.getSelectedIndex();
         if ( mList.getString(index) == " Game 1") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 1 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 2") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 2 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 3") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 3 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 4") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 4 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 5") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 5 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 6") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 6 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 7") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 7 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 8") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 8 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
        else if (c == mExitCommand)
         notifyDestroyed();
      public void pauseApp() {}
      public void destroyApp(boolean unconditional) {}
      private Image loadImage(String name) {
        Image image = null;
        try {
         image = Image.createImage(name);
        catch (IOException ioe) {
          System.out.println(ioe);
      return image;
    }I know that the IF parts pretty much suck, will improve those later on (or when my book does hehe) so that's not the issue. Anyways, I've included a second choice for the user which is what I call "HowMany", so first the user gets to choose between a few options (Game 1, Game 2, etc etc) and then the idea is for the user to choose how many questions, I get to that menu allright but when i try to choose that option nothing happens. I need to include some kind of listener or something to make something actually happen right? If someone would be so nice to show me how it's done it would be just super.
    Thanks in advance!

    I get to that menu allright but when i try to choose that option nothing happens.The form of javax.microedition.lcdui.Display.setCurrent you use ispublic void setCurrent(Alert alert, Displayable nextDisplayable)Which List do you want to be the nextDisplayable? mList or longList?
    Once that works, you will need to add suitable condition checking in commandAction(...) for doing stuff when the Command-s added to longList are selected.
    db

  • Very basic modules questions (ath_pci, etc)

    Hello! (I'm sorry, I posted this one in another forum first, thinking I was posting it in this one :oops: )
    I have a very simple question:
    Where can I find modules (e.g., ah_pci for my Atheros mini PCI wireless card), and where and how do I install them?
    For example, when I do:
    modprobe ath_pci, I get a message saying something like:
    can't find ath_pci module;
    although I've seen a directory with this name on my system (IIRC, under /sys/drivers???).
    Other example:
    I have a 855GM Intelchipset. How do I find the module for it and how do I install it?
    Thanks a lot.

    Thanks for the reply, and for deleting the other thread.
    I looked for /lin/modules, and I don't have a /lin directory... Is it normal?
    Or maybe you meant /bin/modules...? Anyway, I looked for this too and there is no /modules directory under /bin.
    I found some modules under /sys/module. There is one named ide_cd that I put in the MODULES array of rc.conf (just for a test, I don't know why it is for...), but I get a message at bootup:
    [/code]FATAL: module ide_cd not found[code]
    Is this normal too? Or it has to be compiled with the kernel to work. And BTW, if I compile the kernel (I don't think I'm at this point in Linux yet!), do I loose my installation or if everything stays in place in my system?
    Thanks a lot![/code]

  • Very basic String + @ question

    Hello all.
    I'm trying to use the "BitmapMetadata.GetQuery(String query)" method. I've found a few examples online where the argument string is specified as follow:
    string iptcRegion = @"/app13/irb/8bimiptc/iptc/Province\/State";
    As I understand it, the use of "@" is so that I don't have to specify "//" everywhere...but what is the meaning of "\/" at the end just before "State"? Thank you in advance.
    -L

    Thanks Armin, but if it has no special meaning why is it being written that way? I understand that the "@" is specifying a literal string, but something is just not clicking here. I'm sourcing the above strings from two places:
    https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/371f5e90-1a59-412d-8ae0-de7814da6158/iptc-query-using-bitmapmetadatagetquery-method-?forum=windowswic
    and
    http://www.dustyfish.com/blog/basic-editing-of-photo-metadata-using-windows-imaging-component
    I've read and re-read these the two above posts but I just cannot make sense of their use of "/" and "\" and "@". There seem to be 3 different ways being shown and I can't figure out which one is correct. Can anyone clear this
    up for me? Thank you very much.

  • Web Service With Dynamic URL (Very Basic Conceptual Question)

    Hi everyone,
    I would like to employ JAX-WS to generate and publish a web service along with a web-based client which uses the service. The problem is: I want to deliver both the server (with its service) and the client to a customer, who will install the server on an internal machine, and who will have to configure the client to look for the web service at the IP of that internal machine, ideally by just putting the IP into some configuration setting. Both the services' path (on the server) as well as the services remain constant.
    From everything I have found so far, it appears as if one fixes the service's IP during compilation, i.e., when generating the WSDL and stubs using wsgen/wsimport. I guess that's fine when the server remains with me & a fixed IP, but doesn't this approach break down as soon as you need some flexibility in the server's IP, as, e.g., in my above scenario? I guess I am missing something, but unfortunately all the documentation I have found so far either neglects this issue or comes up with rather complex solutions indeed. - Or would one not use SOAP+WSDL in the above scenario in the first place? Any other best practices?
    I'd very grateful for any hints,
    Cheers
    equitone
    Message was edited by:
    Equitone

    Hi,
    thanks for your reply. Of course, I agree I could alter the generated code, but, as you say, I would not want to do that, since it will make automatic builds and deployment rather complicated.
    I guess my expectations on the "flexibility"/"design" of some of the generated artifacts is just a bit skewed, and I'll have to find a compromise between my expectations and the Java 6 way of web services. For instance, I also find it somewhat annoying that wsgen will apparently only generate the service against an implementing class, not an interface. E.g., when I have the following web service interface MyService and an implementing class MyDummyService:
    @WebService
    public interface MyService
        @WebMethod
        public String getString();
    @WebService(endpointInterface = "com....MyService")
    public class MyDummyService implements MyService {
       public String getString() {
          return "Just a dummy.";
    }Then the service in the WSDL specifies its Port as "MyDummyServicePort", so if I ever change the implementation---without actually changing the (web service) interface, I will also have to regenerate all client stubs. I would have hoped that wsgen's "service" option would help in this regard, but apparently it doesn't. Unfortunately, the documentation on the whole issue is in a pitiful state, IMHO.
    Cheers
    Equitone

  • Very basic compiling question: multiple c files

    Hi,
    I've been playing with alchemy for a few days, and hit a road block. I'm sure there is an easy answer, but I can't find it...
    I have a .c file "alchemy_project.c" that lets me call 3 functions from actionscript. I have the basic main() function that sets up the functions and calls
    AS3_LibInit(result);
    It is working well. However, I want to add another c file "support_functions.c" with a function I can call from "alchemy_project.c".
    int testFunction(){
         int i;
         i = 2;
         return i;
    I made a header file "support_functions.h":
    int testFunction();
    I included this header in "alchemy_project.c" by placing it after my AS3.h include:
    #include "AS3.h"
    #include "support_functions.h"
    I compile with:
    alc-on
    gcc alchemy_project.c support_functions.c -Wall -swc alchemy_project.swc
    When I run my flash file, it gives:
    Undefined sym: _main
    If I add a main function to support_functions.c:
    int main(){
        return 0;
    I get:
    [object AlchemyExit]
    Any tips?
    Thanks for the help!

    This helped me a little bit:
    http://forums.adobe.com/thread/465926
    I now compile the 2 c files with:
    gcc -c file1.c -o file1.o
    gcc -c file2.c -o file2.o
    then link them with
    gcc file1.o file2.o file3.o -O3 -Wall -swc --combine lib.swc
    I don't get any errors about main(), but actionscript gives me the error:
    Undefined sym: _testFunction
    when alchemy_project.c tries to call the testFunction() function in support_functions.c

  • Very basic comps question

    Logic Express 8.02. I have four bass takes. Various parts of each are needed. I've read the manual and there is no explanation about how to select just a small section of a take. The only way I see to do it is to go to the beginning, drag all the way to the start point and go all the way to the end and drag left to the end point. After that, however, I see know way to use a later or earlier part of that take again without duplicating the track. I know how it should work. I should be able to "lasso" part the part of the take I want as I go through the song and make the lassoed parts active. The manual touches on this, but when I try to "select the desired take sections by click-dragging over them with the Pointer tool" nothing happens. I'm sure this is really easy, but not easy to figure out. What's the trick? Thanks for any help.

    OK. It seems to be working now. That figures right after I post a question. I hit "revert to saved" and now I see how it works...I think.

  • Very Basic Server Question

    I have a laptop and a mini, and I work on both and have difficulty keeping track of where documents are, which is the latest version, etc. What I'd like is to have is a server on which all the documents are kept and where the drive on the server shows up as a drive on the desktop of the laptop and mini (via wifi). Thus, I would always use the same files on the server via wifi, no matter which computer I'm using.
    Does the Apple server provide this feature? If so, is the connection good enough that there won't be noticeable lag?

    Hi
    +"Does the Apple server provide this feature?"+
    Yes. You don't necessarily require Server OS as any client OS (regardless of platform) can provide simple file sharing. Peer-to-Peer File Sharing is built-into OSX and Windows. All you have to do is decide not to use that designated computer as a workstation. If there are only two workstations OSX Server could be overkill? Perhaps a second-hand G5 with a couple of 1TB drives and 10.5 Client OS would be a cheaper, better option? Other things you need to consider is some form or redundancy and backup. What plans do you have in place if the 'server' drives fails? Additionally do you have the necessary skill set to deploy and maintain a server and its environment?
    Perhaps a NAS drive could be a better, cheaper, easier solution for you?
    +". . . is the connection good enough that there won't be noticeable lag?"+
    Only you can really answer the question. Mileage will vary depending on speed and bandwidth of the network, amount of data in terms of quantity, file sizes etc and frequency of access amongst other things.
    Tony

  • Very basic RMI questions

    I am having troubles finding technical information about how RMI works, exactly. Specifically, I can't find out how the JVM and RMI is working on the remote machine.
    Say you have the server app running and 2 clients invoke the same method at the same time. Does the JVM create a new thread per request? Do these threads exist within the same JVM? (I believe both answers to be "yes"...)
    Basically, I have a program which causes the server to write a serialized objects to disk, and numerous clients are occasionally requesting these serialized objects from the server for remote processing. I want to be sure that the same file can't be served to more than one client.
    If someone can point to me a resource, I'd be delighted.
    Tony

    Your instincts are correct - the remote jvm will spawn separate threads for each incoming request, so you will have to provide some locking mechanism to ensure your serialized objects' state

Maybe you are looking for

  • Merge two rows & show in a single row in table results

    Hi, I need to merge 2 rows having 3 columns in a single row in table view The cols are currently shown as : Project NO-------(Current_Month) Revenue----------(Prior_Month) Revenue 123123 10000 20000 Revenue is a single column with revenue for diffree

  • Insert into

    Dear sirs, please i want to write code inside button on form, this code for insert into table, and i want to write commit_form, but before execute always give me message, is there syntax for make commit after insert into known that i use form 6i best

  • Many rows in DBA_UNDO_EXTENTS

    Hi, in my DBA_UNDO_EXTENTS I have many and many rows with status = UNEXPIRED I'm reading these link: http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/undo.htm and Oracle® Database 2 Day DBA but i don't know how i can delete these row. I

  • Applications problem in 5500 Sport

    Hello I got my 5500 like a month ago, and one time I couldn't open many applications under the "My Own" menu, like the Sensor, Groov Lab, Acrobat Reader, and Snakes applications. And at that time I had my PC infected with the Autoplay virus, the one

  • How to get achieve this in JSP ?

    Hi friends, I am trying to do one scenario in jsp page. here are the steps. 1) when i click on submit button on home page (its already there) a new window should be opened. 2) while opening this new window , it will invoke one shell script and it res