|
@ -58,7 +58,10 @@ public class FrmMain extends JFrame { |
|
|
private JButton btnLoadImg; |
|
|
private JButton btnLoadImg; |
|
|
public static JLabel lblRecipeTitle; |
|
|
public static JLabel lblRecipeTitle; |
|
|
private static DefaultListModel recipesListModel; |
|
|
private static DefaultListModel recipesListModel; |
|
|
|
|
|
|
|
|
|
|
|
private JLabel imgRecipe; |
|
|
|
|
|
private JFileChooser fcImg; |
|
|
|
|
|
private ImageIcon imgDefaultRecipe; |
|
|
|
|
|
private JList recipesList; |
|
|
|
|
|
|
|
|
void DeactivateAddMenu() { |
|
|
void DeactivateAddMenu() { |
|
|
btnCancel.setVisible(false); |
|
|
btnCancel.setVisible(false); |
|
@ -71,6 +74,7 @@ public class FrmMain extends JFrame { |
|
|
txtIngredients.setEditable(false); |
|
|
txtIngredients.setEditable(false); |
|
|
txtTags.setEditable(false); |
|
|
txtTags.setEditable(false); |
|
|
lblRecipeTitle.setVisible(true); |
|
|
lblRecipeTitle.setVisible(true); |
|
|
|
|
|
recipesList.setEnabled(true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void ActivateAddMenu() { |
|
|
void ActivateAddMenu() { |
|
@ -84,6 +88,8 @@ public class FrmMain extends JFrame { |
|
|
txtIngredients.setEditable(true); |
|
|
txtIngredients.setEditable(true); |
|
|
txtTags.setEditable(true); |
|
|
txtTags.setEditable(true); |
|
|
lblRecipeTitle.setVisible(false); |
|
|
lblRecipeTitle.setVisible(false); |
|
|
|
|
|
recipesList.setEnabled(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//czyszczenie pól formularza |
|
|
//czyszczenie pól formularza |
|
|
txtDescription.setText(""); |
|
|
txtDescription.setText(""); |
|
@ -145,7 +151,7 @@ public class FrmMain extends JFrame { |
|
|
panel.add(btnSearch, gbc_btnSearch); |
|
|
panel.add(btnSearch, gbc_btnSearch); |
|
|
|
|
|
|
|
|
recipesListModel = new DefaultListModel(); |
|
|
recipesListModel = new DefaultListModel(); |
|
|
final JList recipesList = new JList(recipesListModel); |
|
|
|
|
|
|
|
|
recipesList = new JList(recipesListModel); |
|
|
recipesList.addListSelectionListener(new ListSelectionListener() { |
|
|
recipesList.addListSelectionListener(new ListSelectionListener() { |
|
|
public void valueChanged(ListSelectionEvent e){ |
|
|
public void valueChanged(ListSelectionEvent e){ |
|
|
if(recipesList.getSelectedIndex() != -1) |
|
|
if(recipesList.getSelectedIndex() != -1) |
|
|