Skip to content

Commit b8a2086

Browse files
committed
Cập nhật chức năng tự lưu role + check lưu thông tin đăng nhập
1 parent 6c04527 commit b8a2086

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

build/classes/oracle/Main$7.class

0 Bytes
Binary file not shown.

build/classes/oracle/Main.class

393 Bytes
Binary file not shown.

build/classes/oracle/Main.form

-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@
152152
</Component>
153153
<Component class="javax.swing.JLabel" name="jLabel3">
154154
<Properties>
155-
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
156-
<Font name="Segoe UI" size="12" style="0"/>
157-
</Property>
158155
<Property name="text" type="java.lang.String" value="&#x110;&#x1ecb;a ch&#x1ec9;"/>
159156
</Properties>
160157
</Component>

login.dat

28 Bytes
Binary file not shown.

src/oracle/Main.form

-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@
152152
</Component>
153153
<Component class="javax.swing.JLabel" name="jLabel3">
154154
<Properties>
155-
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
156-
<Font name="Segoe UI" size="12" style="0"/>
157-
</Property>
158155
<Property name="text" type="java.lang.String" value="&#x110;&#x1ecb;a ch&#x1ec9;"/>
159156
</Properties>
160157
</Component>

src/oracle/Main.java

+11
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ else if (cbbRole.getSelectedItem().equals("Thường"))
214214
ObjectOutputStream out = new ObjectOutputStream(fileOut);
215215
out.writeObject(username);
216216
out.writeObject(password);
217+
// Luu trang thai checkbox
218+
out.writeObject("check");
219+
// Luu trang thai combobox
220+
out.writeObject(cbbRole.getModel().getSelectedItem().toString());
217221
out.close();
218222
fileOut.close();
219223
} catch (IOException i) {
@@ -227,6 +231,8 @@ else if(ckbRemeberMe.isSelected()==false)
227231
ObjectOutputStream out = new ObjectOutputStream(fileOut);
228232
out.writeObject("");
229233
out.writeObject("");
234+
out.writeObject("");
235+
out.writeObject("");
230236
out.close();
231237
fileOut.close();
232238
} catch (IOException i) {
@@ -300,6 +306,11 @@ private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event
300306

301307
txtUsername.setText((String) in.readObject());
302308
txtPassword.setText((String) in.readObject());
309+
if (in.readObject().toString().equalsIgnoreCase("check")) {
310+
ckbRemeberMe.setSelected(true);
311+
}
312+
cbbRole.getModel().setSelectedItem(in.readObject());
313+
303314
in.close();
304315
fileIn.close();
305316

0 commit comments

Comments
 (0)