Skip to content

Commit

Permalink
Swap native and foreign word in WordDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
berk76 committed Oct 31, 2020
1 parent d6043e7 commit 502ce5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/main/java/cz/webstones/words/WordDialog.form
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="18" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Native word"/>
<Property name="text" type="java.lang.String" value="Foreign word"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField1">
Expand All @@ -139,7 +139,7 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="18" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Foreign word"/>
<Property name="text" type="java.lang.String" value="Native word"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField2">
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/cz/webstones/words/WordDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public void setWord(WordDto w) {
this.word = w;

Font f;
f = Service.findFont(this.word.getCz(), jTextField1.getFont());
f = Service.findFont(this.word.getCz(), jTextField2.getFont());
jTextField1.setFont(f);
f = Service.findFont(this.word.getEn(), jTextField2.getFont());
f = Service.findFont(this.word.getEn(), jTextField1.getFont());
jTextField2.setFont(f);

jTextField1.setText(this.word.getCz());
jTextField2.setText(this.word.getEn());
jTextField2.setText(this.word.getCz());
jTextField1.setText(this.word.getEn());

updateCategoryCombo();
jComboBox1.setSelectedItem(this.word.getCategory());
Expand All @@ -72,9 +72,9 @@ public void setWord(WordDto w) {
}

public void setForeignWordEditable(boolean b) {
jTextField2.setEditable(b);
jTextField2.setEnabled(b);
jTextField2.setFocusable(b);
jTextField1.setEditable(b);
jTextField1.setEnabled(b);
jTextField1.setFocusable(b);
}

private void updateCategoryCombo() {
Expand Down Expand Up @@ -138,13 +138,13 @@ private void initComponents() {
setTitle("Edit word");

jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel1.setText("Native word");
jLabel1.setText("Foreign word");

jTextField1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jTextField1.setText("jTextField1");

jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel2.setText("Foreign word");
jLabel2.setText("Native word");

jTextField2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jTextField2.setText("jTextField2");
Expand Down Expand Up @@ -293,8 +293,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
WordDto tmp = new WordDto();
tmp.setCz(jTextField1.getText().trim());
tmp.setEn(jTextField2.getText().trim());
tmp.setCz(jTextField2.getText().trim());
tmp.setEn(jTextField1.getText().trim());
tmp.setCategory(jComboBox1.getSelectedItem().toString());

try {
Expand Down

0 comments on commit 502ce5e

Please sign in to comment.