44 */
55package gui ;
66
7+ import application .InfoSoftware ;
78import java .awt .Desktop ;
89import java .net .URI ;
910import java .net .URL ;
@@ -36,6 +37,8 @@ private void initComponents() {
3637 jMenuBar1 = new javax .swing .JMenuBar ();
3738 jMenu1 = new javax .swing .JMenu ();
3839 menuItem_ViewMyProfile = new javax .swing .JMenuItem ();
40+ menuItem_Info = new javax .swing .JMenuItem ();
41+ menuItem_Download = new javax .swing .JMenuItem ();
3942 menuItem_XemMaNguon = new javax .swing .JMenuItem ();
4043
4144 setDefaultCloseOperation (javax .swing .WindowConstants .EXIT_ON_CLOSE );
@@ -51,6 +54,22 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
5154 });
5255 jMenu1 .add (menuItem_ViewMyProfile );
5356
57+ menuItem_Info .setText ("Thông tin phần mềm" );
58+ menuItem_Info .addActionListener (new java .awt .event .ActionListener () {
59+ public void actionPerformed (java .awt .event .ActionEvent evt ) {
60+ menuItem_InfoActionPerformed (evt );
61+ }
62+ });
63+ jMenu1 .add (menuItem_Info );
64+
65+ menuItem_Download .setText ("Tải phiên bản mới" );
66+ menuItem_Download .addActionListener (new java .awt .event .ActionListener () {
67+ public void actionPerformed (java .awt .event .ActionEvent evt ) {
68+ menuItem_DownloadActionPerformed (evt );
69+ }
70+ });
71+ jMenu1 .add (menuItem_Download );
72+
5473 menuItem_XemMaNguon .setText ("Xem mã nguồn mở" );
5574 menuItem_XemMaNguon .addActionListener (new java .awt .event .ActionListener () {
5675 public void actionPerformed (java .awt .event .ActionEvent evt ) {
@@ -88,6 +107,26 @@ private void menuItem_ViewMyProfileActionPerformed(java.awt.event.ActionEvent ev
88107 }
89108 }//GEN-LAST:event_menuItem_ViewMyProfileActionPerformed
90109
110+ private void menuItem_DownloadActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_menuItem_DownloadActionPerformed
111+ // TODO add your handling code here:
112+
113+ try {
114+ URL url = new URL ("https://github.com/kennex666/EncryptionAlgorithm-Java/releases/" );
115+
116+ openWebpage (url .toURI ());
117+ } catch (Exception e ) {
118+ JOptionPane .showMessageDialog (null , "Không thể mở web do thiếu API Desktop, truy cập tại: https://github.com/kennex666/EncryptionAlgorithm-Java/releases/" );
119+ }
120+ }//GEN-LAST:event_menuItem_DownloadActionPerformed
121+
122+ private void menuItem_InfoActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_menuItem_InfoActionPerformed
123+ // TODO add your handling code here:
124+ JOptionPane .showMessageDialog (null ,
125+ "Các thuật toán mã hoá - Phiên bản " + InfoSoftware .VERSION
126+ + "\n Viết bởi: Dương Thái Bảo"
127+ );
128+ }//GEN-LAST:event_menuItem_InfoActionPerformed
129+
91130 public static boolean openWebpage (URI uri ) {
92131 Desktop desktop = Desktop .isDesktopSupported () ? Desktop .getDesktop () : null ;
93132 if (desktop != null && desktop .isSupported (Desktop .Action .BROWSE )) {
@@ -140,6 +179,8 @@ public void run() {
140179 private javax .swing .JMenu jMenu1 ;
141180 private javax .swing .JMenuBar jMenuBar1 ;
142181 private javax .swing .JTabbedPane jTabbedPane1 ;
182+ private javax .swing .JMenuItem menuItem_Download ;
183+ private javax .swing .JMenuItem menuItem_Info ;
143184 private javax .swing .JMenuItem menuItem_ViewMyProfile ;
144185 private javax .swing .JMenuItem menuItem_XemMaNguon ;
145186 // End of variables declaration//GEN-END:variables
@@ -148,7 +189,7 @@ private void initApp() {
148189 Panel_MaHoaCoDien panelMaHoaCoDien = new Panel_MaHoaCoDien ();
149190
150191 jTabbedPane1 .add (panelMaHoaCoDien , "Mã hoá cổ điển" );
151- this .setTitle ("Các thuật toán mã hoá | (c) Dương Thái Bảo - DHKTPM17B - FIT@IUH" );
192+ this .setTitle ("Các thuật toán mã hoá | " + InfoSoftware . VERSION + " | (c) Dương Thái Bảo - DHKTPM17B - FIT@IUH" );
152193
153194 }
154195}
0 commit comments