poprawiona obsługa przycisków w UI
This commit is contained in:
BIN
cookbook.db
Normal file
BIN
cookbook.db
Normal file
Binary file not shown.
@@ -9,7 +9,7 @@ import db.Recipe;
|
||||
public class Cookbook {
|
||||
|
||||
public static final String DRIVER = "org.sqlite.JDBC";
|
||||
public static final String DB_URL = "jdbc:sqlite:cookbook";
|
||||
public static final String DB_URL = "jdbc:sqlite:cookbook.db";
|
||||
|
||||
private Connection conn;
|
||||
private Statement stat;
|
||||
|
||||
@@ -58,7 +58,10 @@ public class FrmMain extends JFrame {
|
||||
private JButton btnLoadImg;
|
||||
public static JLabel lblRecipeTitle;
|
||||
private static DefaultListModel recipesListModel;
|
||||
|
||||
private JLabel imgRecipe;
|
||||
private JFileChooser fcImg;
|
||||
private ImageIcon imgDefaultRecipe;
|
||||
private JList recipesList;
|
||||
|
||||
void DeactivateAddMenu() {
|
||||
btnCancel.setVisible(false);
|
||||
@@ -71,6 +74,7 @@ public class FrmMain extends JFrame {
|
||||
txtIngredients.setEditable(false);
|
||||
txtTags.setEditable(false);
|
||||
lblRecipeTitle.setVisible(true);
|
||||
recipesList.setEnabled(true);
|
||||
}
|
||||
|
||||
void ActivateAddMenu() {
|
||||
@@ -84,6 +88,8 @@ public class FrmMain extends JFrame {
|
||||
txtIngredients.setEditable(true);
|
||||
txtTags.setEditable(true);
|
||||
lblRecipeTitle.setVisible(false);
|
||||
recipesList.setEnabled(false);
|
||||
|
||||
|
||||
//czyszczenie pól formularza
|
||||
txtDescription.setText("");
|
||||
@@ -145,7 +151,7 @@ public class FrmMain extends JFrame {
|
||||
panel.add(btnSearch, gbc_btnSearch);
|
||||
|
||||
recipesListModel = new DefaultListModel();
|
||||
final JList recipesList = new JList(recipesListModel);
|
||||
recipesList = new JList(recipesListModel);
|
||||
recipesList.addListSelectionListener(new ListSelectionListener() {
|
||||
public void valueChanged(ListSelectionEvent e){
|
||||
if(recipesList.getSelectedIndex() != -1)
|
||||
|
||||
Reference in New Issue
Block a user