I have five buttons in my current GUI named Browse, Unzip, Convert, Copy and Zip. First event is browse and by using that button I upload a zipped file and then click on unzip to unzip that file followed by convert and copy buttons and finally Zip the file again by clicking on Zip button. I have kept them in a sequential order and click on them one by one but I want to put these actions as Browse, Next, Next, Next and Finish button. So please help me out in achieving this task.
My Java Swing (Netbeans) code looks like:
public class MyClass extends javax.swing.JFrame {
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {
//Code here
}
private void unzipButtonActionPerformed(java.awt.event.ActionEvent evt) {
//Code here
}
private void convertButtonActionPerformed(java.awt.event.ActionEvent evt) {
//Code here
}
private void copyButtonActionPerformed(java.awt.event.ActionEvent evt) {
//Code here
}
private void zipButtonActionPerformed(java.awt.event.ActionEvent evt) {
//Code here
}
}
Thanking you!
This sounds like a classic wizard application with CardLayout.
You could create a base panel in the BorderLayout.SOUTH position of your JFrame that would have your action buttons and have a number of panels added to your main panel being managed by CardLayout.
See Creating Wizard Dialogs with Java Swing