diff --git a/voting-booth-gui/VotersBallot.png b/voting-booth-gui/VotersBallot.png index 992e0d5..e1e48dd 100644 Binary files a/voting-booth-gui/VotersBallot.png and b/voting-booth-gui/VotersBallot.png differ diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/straight_channel_section/StraightChannelSectionController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/straight_channel_section/StraightChannelSectionController.java index 10fd082..ed2e9c1 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/straight_channel_section/StraightChannelSectionController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/straight_channel_section/StraightChannelSectionController.java @@ -50,6 +50,7 @@ public class StraightChannelSectionController extends TwoWayNode { this.logger.debug("Created and filled with zeros the channel value."); this.updateVisualChanel(); + this.UpdateVotersChoise(); } /** diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java index eec4ecc..7ef85a6 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java @@ -15,6 +15,10 @@ import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.ImageIcon; +import java.awt.image.BufferedImage; /** * Created by Vladimir Eliezer Tokarev on 8/27/2016. @@ -33,6 +37,7 @@ public class VoteHaveBeenCastController extends TwoWayNode { BufferedImage image = BarcodeImageHandler.getImage(barcode); File outputfile = new File("VotersBallot.png"); ImageIO.write(image, "png", outputfile); + showBallot("VotersBallot.png"); this.logger.debug("Created the bar code with voters choises at VotersBallot.png."); } @@ -50,4 +55,15 @@ public class VoteHaveBeenCastController extends TwoWayNode { public void UpdateNode() { // This panel doesn't have any questions representations that why there is nothing ti show here } + + private void showBallot(String filename) throws IOException { + final JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); +// bi = ImageIO.read(ImageResourceDemo.class.getResource("../resource/avatar6.jpeg")); + BufferedImage bi = ImageIO.read(new File(filename)); + frame.add(new JLabel(new ImageIcon(bi))); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } }