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.

Similar Messages

  • Help with Applescript: very basic functions

    Hi guys, my first post. I'd very much like to switch from Excel to Numbers but not until I find an Applescript replacement for my stuff.
    I wrote basic Excel Applescript just fine but I'm tearing my hair out just to perform simple scripts in Numbers!!!
    Basically I need to do:
    PART 1: Import External Data
    - I think I got this covered, using a GUI copy script via the "System Events" application
    - but since you guys are the experts: how do I make this process 'invisible'? i.e. each time the script runs, a Safari window appears. I don't want that to happen.
    tell application "Safari"
    activate
    open location "http://www.whatever.htm"
    end tell
    tell application "System Events"
    tell process "Safari"
    keystroke "a" using command down
    keystroke "c" using command down
    end tell
    end tell
    PART 2: Paste It Into Numbers
    - How hard can it be, right? Apparently I have the mental IQ of Gump I need Numbers to:
    - clear data from an existing pre-defined/named table
    - paste the data (from clipboard) onto this table (paste starting on cell A1), using the "Paste and Match Style" function
    - hide certain columns <-- I realize if Numbers paste onto a table with hidden columns, it treats them as non-existent i.e. won't paste the same. Therefore I suppose before the paste script I'd need an unhide script
    ... and that's it!!
    Help please I really hate Excel but can't move on till I figure this out... it's crucial to my livelihood.
    Thank you all in advance!

    There is no paste function in the Numbers AppleScript's dictionary.
    We may mimic it as I did during one year and a half with Numbers '08.
    Go to my iDisk:
    <http://idisk.me.com/koenigyvan-Public?view=web>
    open the folder "For_iWork:iWork '08:for_Numbers:"
    and download one of the items whose name starts with "paste".
    This use of GUI scripting is interesting because it creates automatically rows/columns when required.
    One draw back is the resulting font.
    Yvan KOENIG (from FRANCE samedi 17 janvier 2009 21:12:52)

  • Help with a very basic select

    Hi, I am embarrassed to say this but I can't figure out why this select isn't working. 
    SELECT single adrnr INTO w_adrnr FROM lfa1
      WHERE lifnr = w_lifnr.
    I know that I have a match in LFA1 where LIFNR = W_LIFNR but the select will not return anything.  Can you tell me what [obvious] mistake I have made?
    Regards,
    Davis

    Davis,
    did you see data at SE11 ? if so then use
    Use Below FM -> pass CONVERSION_EXIT_ALPHA_INPUT
    give input w_lifnr and output is w_lifnr
    SELECT single adrnr INTO w_adrnr FROM lfa1
      WHERE lifnr = w_lifnr.
    now see the results
    Thanks
    Seshu

  • Hoping for some help with a very frustrating issue!   I have been syncing my iPhone 5s and Outlook 2007 calendar and contacts with iCloud on my PC running Vista. All was well until the events I entered on the phone were showing up in Outlook, but not

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

  • TS2446 Hello, I'm Bethany and I'm having trouble with my apple ID I tried to buy something from he app store and they assed me some questions and anyway i have locked my account and don't know how to unlock any help with be very helpful thanks.

    Hello, I'm Bethany and I'm having trouble with my apple ID I tried to buy something from he app store and they assed me some questions and anyway i have locked my account and don't know how to unlock any help with be very helpful thanks.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Can someone help me with a very basic guide to animated gif with elements 11?

    Hi
    I bought Adobe elements 11 and have been trying to do a very basic animated gif with it.I came acroos some instructions about layering,etc but still cannot get it to work. All I want to do is add two of my school photos together so that one suddenly vanishes and the one appears.I am planning to put this on my blog.
    The animation I want is the day time picture of teh school magically vanish and the night time picture appear.Can it be done with elements11(I wouldn't mind if someone can even do it for me so that I could deconstruct it later!).I have attached the two photos.Please remember ,my knowledge of phtoshop is abysmal and very very basic.My apologies for that.hence I might be need to be told like a 10-year old!
    Please help as I need this fast! Karen.

    It’s not possible to fade between gif images but you could sandwich two layers with a black fill layer between them as I have done in this example.
    Then use the menu:
    File >> Save For Web
    Choose gif as the file type, select animate, and set your timing in seconds with continuous loop if required.
    Then Save.
    PS the images are different sizes so I had to re-size the daylight image to make it the same as the night image.
    Click to view

  • [New] Help with a VERY simple asterisk program.

    Alright...I feel like a complete idiot asking this question..but I'm having such trouble writing this program. The program description is here:
    Write a Java application using two for loops to produce the following pattern of asterisks.
    I guess I'm really bad at algorithms yeah? Haha...well, any help would be very much appreciated.

    Hi,
    I don't think you don't need to look through any C programming books.
    When you have a problem like this, do some thinking about what methods you need to use and what the general structure of the program will be.
    You need to print asterisks out to the screen... so you'll need:
    System.out.println
    System.out.printAnd you already know that you need two loops.
    Now you can ask yourself how you might use the print statements with two loops in order to design a basic structure for the program.
    You have 8 lines, so you might want a loop that runs through 8 times, one of the lines printed each time.
    Within this loop, you need another loop that prints out *'s. This loop could run once for each asterisk, but because there is a different number of asterisks on each line, the number of times this loop runs would be variable.
    So a basic structure:
    //loop1 that runs 8 times
        //loop2 that runs once for each *
            print one star
        //end loop2
    //end loop1The key now is to recognise the difference between print and println. I don't know if you alread know, but System.out.print will print a string without creating a new line at the end, and println will create a new line at the end of the printed string.
    Hope that helps. If you have any other problems, post specific questions along with the code you've written and are having trouble with.

  • Help with a very simple horizontal Spry menu

    Hi,
    I’ve always received great help here and I’m sure that if I explain the issue I’m having properly I’ll get some good input.
    This is to do with a very simple horizontal Spry menu, there’s no dropdown involved, only a color change on the rollover.  The menu items are in a shade of blue, then on the rollover each menu item changes to a shade of red, the font color remains white for both.
    What’s mentioned above works flawlessly, the problem I’m having is this … On the rollover when the menu block items turn red, I’m attempting to add a 1px border around the entire block, but when I do the block item seems to want to change its width and height slightly when it’s rolled-over.  As I said, without the border it works perfect.
    Any suggestions will be appreciated.

    steve0308 wrote:
    Hi,
    I’ve always received great help here and I’m sure that if I explain the issue I’m having properly I’ll get some good input.
    This is to do with a very simple horizontal Spry menu, there’s no dropdown involved, only a color change on the rollover.  The menu items are in a shade of blue, then on the rollover each menu item changes to a shade of red, the font color remains white for both.
    What’s mentioned above works flawlessly, the problem I’m having is this … On the rollover when the menu block items turn red, I’m attempting to add a 1px border around the entire block, but when I do the block item seems to want to change its width and height slightly when it’s rolled-over.  As I said, without the border it works perfect.
    Any suggestions will be appreciated.
    You also have to apply the border to the 'a' css selector. If you just apply it to the 'a:hover' css selector then the tab will grow slightly bigger because its adding more width and height to the overall structure.

  • Can someone tell me the problem with this (very basic) code

    I know it's very basic but here goes
    public class MilesAndFurlongs
    // the constructor
    public MilesAndFurlongs (int Furlongs, int Miles)
    amountFurlongs = Furlongs;
    amountMiles = Miles;
    // method to add one to furlong
    public void increment()
    amount = (amount + 1);
    // method to print out total number of furlongs and miles
    public void displayLength()
    system.out.println("Furlongs: " + amountFurlongs);
    system.out.println("Miles: " + amountMiles);
    bluej says theres an illegal start of expression in displaylength()
    i know its going to be something stupid :D

    this is all of it updated...
    public class MilesAndFurlongs
    // the constructor
    public MilesAndFurlongs (int Furlongs, int Miles)
    amountFurlongs = Furlongs;
    amountMiles = Miles;
    // method to add one to furlong
    public void increment()
    amount = (amount + 1);
    // method to print out total number of furlongs and miles
    public void displayLength()
    system.out.println("Furlongs: " + amountFurlongs);
    system.out.println("Miles: " + amountMiles);
    Message was edited by:
    jaytabbmeister

  • Please help me with this very basic question!

    Hi all,
    I m new to O/R mapping framework, my question is quite simple. Is iBatis an Object Relational Mapping technique? If it is, which one is better, iBatis or OJB?
    Thank your for your help!
    best regards

    Yes it is.
    "Which is better" is always a bad question. It depends how you intend to use them. Plus there are quite a lot of other ORM solutions, so even if one were objectively better than the other, it might still be a poor choice.

  • Help me with Javaaaa (very basic)

    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
    Caused by: java.lang.ClassNotFoundException: HelloWorld
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: HelloWorld. Program will exit.
    Press any key to continue . . .
    Is what happens after I compile it, when I compile no errors come, and a .class file appears, BUT when I do java HelloWorld, it doesn't work.
    Help me plzzzzzzzzz :D :D :D
    Thanks in advanced,
    D3st1ny
    Tthis is the main file HelloWorld.java
    class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!!");
    }

    Iiiiiinnnnnn tttthhhheeeee fffffuuuuuuttttuuurrreee,,,,,,, pppllleeeeaassssseeeee uuuuusssseeeee rrreeeaaaallllll, ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppprrrrrrrrooooooooppppppeeeeerrrrrrllllllyyyyy ssspppppeeellllllleedddddd wwwwwoooorrrrdddddsssssss.

  • Need Help with a very simple view transition scenario

    Hello All,
    I am trying to learn how view transitions work and I am having a very hard time with the sample apps (like transition view app etc)...I need something much more simple at first. Can you please provide me a little guidelines on how to set up this following scenario:
    App loads up and shows a title screen with a button that says go. When you click on the go button the title screen fades out and a new view fades in (or slides in, or anything at all).
    Right now I have 3 nib files. There is the main one that is called on application start (tied with MainViewController, a subclass of IUViewcontroller just like in the hello world app. After the app loads the app delegate object tells the MainViewController object to load in another view controller object (via addSubview) which is tied with the second nib file; my title screen with the button. When I press the button I was thinking in the IBAction function to tell the MainViewController object to remove (or transition out somehow) the title screen view controller object then add the other view (third nib file in). This is the part I can't get working. Am I on the right track or have a gone hideously astray? Thank you!

    hi,
    i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
    i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
    1) from the appdelegate i initialize a root controller (view controller class)
    2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
    3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
    4) we also need viewA and viewB files(view class)
    5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
    5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
    it will look something like this:
    [Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
    so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
    i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps.

  • Help with Hiss Removal / Basic Audio Problems

    Hey guys.  I have a Panasonic HDC-TM700 with an attached Azden High-performance (SMX-10) Stereo Condenser Microphone.  I use it to record a person talking about 6 feet away in small room.  However the audio always sounds horrible on playback.  By horrible I mean there is always a loud hiss, and they sound so flat.  Since I have to do this on a weekly basis now I am hoping somebody here can give me some pointers on how to fix these issues.  I assume it a fairly issue fix in Adobe Audition CS 5.5 (which I have).  I start my production in Premiere Pro CS5.5 and then export the audio to Adobe Audition for editing.  My problem is ive never been a sound guy so I really don’t understand what all the filters and settings do (in Premiere or Audition).  I was able to “capture the noise” and have Auditon “remove it”.   That does an ok job of removing the hiss… but then the already flat voice left over, sounds very tinny.  
    So is there any advice or direction you can give me on what settings to use or apply to get audition to make the audio sound better?  Or is there anywhere (for beginners) to learn how to use the settings?  I think my problem is that I don’t understand the basics of audio like what EQ or a compressor does, and how the settings effect things.  But everything I read is so technical and it just confuses me more. 
    Or are there any other microphones (under $200.00) anybody could suggest that would be able to be added to this camera that could get me better audio for my situation?  
    I would really appreciate any advice, or a point in the right direction.  Thanks guys.

    I'm afraid my answer isn't going to make you happy.  A microphone mounted on a camera six feet away from a speaker isn't ever going to give you the results you're after.  Audition may be able to help a little but the real trick is to get the mic much closer to the speaker, especially in a small room which is going to sound hollow and boomy.  Effectively what you're asking is like "if I shoot on a wide angle lens, how can I zoom into a closeup in editing without losing resolution".  Sound is just as unforgiving.  When I was working as a sound guy for video, the trick was always to get the mic in as close as possible without getting into shot--even with a thousand dollar mic, I couldn't just stand by the camera and get good results--well, at least not without a long fish pole!
    How you do this is going to depend on the details of your shoot.   You might try a shotgun mic on a fishpole boom--the cheapest shotgun I know is the Rode NTG2 but this with a fishpole will blow your $200 budget.  (There's also the NTG1 but this needs phantom power and I'll assume you can't provide that.
    Or, in a static situation, there are various clip on lavalier mics you could try--Sennheiser do at least one within your budget (or used to--haven't checked lately) that can be powered with a little button battery.
    Either way, though, the trick is to get the mic much closer to the subject.
    For material you already have, the only suggestion I have is to do your hiss reduction in several small steps rather than trying to do it all at once.  This should result in the remaining voice sounding less "processed" but it's still not the same as getting the recording right to start with.

  • I need help with random number in GUI

    hello
    i have home work about the random number with gui. and i hope that you can help me doin this application. and thank you very much
    Q1)
    Write an application that generates random numbers. The application consists of one JFrame,
    with two text fields (see the figures) and a button. When the user clicks on the button, the
    program should generate a random number between the minimum and the maximum numbers
    entered in the text fields. The font of the number should be in red, size 100, bold and italic.
    Moreover, if the user clicks on the generated number (or around it), the color of the background
    should be changed to another random color. The possible colors are red, green blue , black ,cyan
    and gray.
    Notes:
    �&#61472;The JFrame size is 40 by 200
    �&#61472;The text fields size is 10
    this is a sample how should the programe look like.
    http://img235.imageshack.us/img235/9680/outputgo3.jpg
    Message was edited by:
    jave_cool

    see java.util.Random

  • Need help with a very simple example.  Trying to reference a value

    Im very new to Sql Load and have created this very simple example of what I need to do.
    I just want to reference the ID column from one table to be inserted into another table as DEV_ID.
    Below are my: 1) Control File, 2) Datafile, 3) Table Description, 4) Table Description
    1) CONTROL FILE:
    LOAD DATA
    INFILE 'test.dat'
    APPEND
    INTO TABLE p_ports
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    DEV_id REF(CONSTANT 'P_DEVICES',NAME),
    NAME FILLER ,
    PORT_NO
    2) DATAFILE:
    COMM881-0326ES09,6
    3) TABLE DESCRIPTION:
    SQL> describe p_ports
    Name Null? Type
    ID NOT NULL NUMBER(10)
    DEV_ID NOT NULL NUMBER(10)
    PORT_NO     NUMBER(3)

    hi,
    i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
    i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
    1) from the appdelegate i initialize a root controller (view controller class)
    2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
    3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
    4) we also need viewA and viewB files(view class)
    5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
    5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
    it will look something like this:
    [Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
    so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
    i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps.

Maybe you are looking for

  • How to track the corresponding CWIP and Asset after settlement in reports

    Dear gurus, We are trying to develop a single report which would have commitments, actual costs, Auc amounts and Final Asset postings w.r.t a project or WBS element. What is the table where we can find AuC amount and CWIP number for given WBS element

  • Set item value at other page via URL-redirect

    Hi, I have a button and I want to open a new window with it using an url-target. </br> </br> javascript:window.open ('f?p=&APP_ID.:143:&SESSION.::NO:143:P143_KDT_ID,P143_MESSAGE:&P140_KDT_ID.,&P140_MESSAGE.') </br> </br> When I use branching I get an

  • Proxy-to-File scenario. Acknologements.

    Hello Experts, We have a Proxy-to-File scenario, is it possible to receive on SAP-backend side acknolegement that the file was succesfully delivered to target FTP server. What are the options for this requirement? The only solution I can see right no

  • Implementing database records through Trees

    I am having a problem regarding trees.. Can anyone send me the code ,how to implement records from the Database through trees.. i m using JDBC. Please let me know soon .. and send me the syntax aswell.. Bye.. Thankssss

  • I cant start my new iphone 4s

    my new iphone 4s not responding to power on and power adapter