I want to program a application, when I push the start button, it runs a ffmpeg command to record a online stream, when I push the stop button, I want to send a "q" key to stop the recording. how should I do?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I want to program a application, when I push the start button, it runs a ffmpeg command to record a online stream, when I push the stop button, I want to send a "q" key to stop the recording. how should I do?
you have to add an actionListener to your button like this:
yourButtonName.addActionListener(new actionListener(){.....});
actionListener is an interface so you have to over write the method actionperformed and add what you want to do with your application (depending on which button user pressed)
Hello mt888.
There is a code snippet for actionListener here:
http://www.javaprogrammingforums.com...ava-swing.html
There is also a tutorial for the robot class here:
http://www.javaprogrammingforums.com...bot-class.html
I hope this helps!
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
I don't thnk Robot willl come into it, isn't ffmpeg a command line app?
@OP: Recommended reading (go through ALL parts)
When Runtime.exec() won't - JavaWorld
db