|
@ -35,11 +35,16 @@ import java.io.File; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import javax.swing.SwingConstants; |
|
|
import javax.swing.SwingConstants; |
|
|
import ksiazka.kucharska.RetrieveData; |
|
|
import ksiazka.kucharska.RetrieveData; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.event.DocumentEvent; |
|
|
|
|
|
import javax.swing.event.DocumentListener; |
|
|
import javax.swing.event.ListSelectionListener; |
|
|
import javax.swing.event.ListSelectionListener; |
|
|
import javax.swing.event.ListSelectionEvent; |
|
|
import javax.swing.event.ListSelectionEvent; |
|
|
import javax.swing.filechooser.FileNameExtensionFilter; |
|
|
import javax.swing.filechooser.FileNameExtensionFilter; |
|
|
import javax.swing.ScrollPaneConstants; |
|
|
import javax.swing.ScrollPaneConstants; |
|
|
import java.awt.Dimension; |
|
|
import java.awt.Dimension; |
|
|
|
|
|
import java.awt.event.InputMethodListener; |
|
|
|
|
|
import java.awt.event.InputMethodEvent; |
|
|
|
|
|
|
|
|
public class FrmMain extends JFrame { |
|
|
public class FrmMain extends JFrame { |
|
|
|
|
|
|
|
@ -48,7 +53,7 @@ public class FrmMain extends JFrame { |
|
|
*/ |
|
|
*/ |
|
|
private static final long serialVersionUID = 2634383304749703669L; |
|
|
private static final long serialVersionUID = 2634383304749703669L; |
|
|
private JPanel contentPane; |
|
|
private JPanel contentPane; |
|
|
private JTextField txtSearch; |
|
|
|
|
|
|
|
|
public static JTextField txtSearch; |
|
|
public static JTextField txtEdTitle; |
|
|
public static JTextField txtEdTitle; |
|
|
public static JTextField txtTags; |
|
|
public static JTextField txtTags; |
|
|
private JButton btnSave; |
|
|
private JButton btnSave; |
|
@ -124,7 +129,7 @@ public class FrmMain extends JFrame { |
|
|
setContentPane(contentPane); |
|
|
setContentPane(contentPane); |
|
|
|
|
|
|
|
|
JSplitPane splitPane = new JSplitPane(); |
|
|
JSplitPane splitPane = new JSplitPane(); |
|
|
splitPane.setResizeWeight(0.18); |
|
|
|
|
|
|
|
|
splitPane.setResizeWeight(0.1); |
|
|
splitPane.setRequestFocusEnabled(false); |
|
|
splitPane.setRequestFocusEnabled(false); |
|
|
splitPane.setPreferredSize(new Dimension(200, 27)); |
|
|
splitPane.setPreferredSize(new Dimension(200, 27)); |
|
|
splitPane.setDividerSize(5); |
|
|
splitPane.setDividerSize(5); |
|
@ -142,7 +147,8 @@ public class FrmMain extends JFrame { |
|
|
panel.setLayout(gbl_panel); |
|
|
panel.setLayout(gbl_panel); |
|
|
|
|
|
|
|
|
txtSearch = new JTextField(); |
|
|
txtSearch = new JTextField(); |
|
|
txtSearch.setText("wpisz tytuł/tagi..."); |
|
|
|
|
|
|
|
|
txtSearch.setText(""); |
|
|
|
|
|
|
|
|
GridBagConstraints gbc_txtSearch = new GridBagConstraints(); |
|
|
GridBagConstraints gbc_txtSearch = new GridBagConstraints(); |
|
|
gbc_txtSearch.gridwidth = 2; |
|
|
gbc_txtSearch.gridwidth = 2; |
|
|
gbc_txtSearch.insets = new Insets(5, 5, 5, 0); |
|
|
gbc_txtSearch.insets = new Insets(5, 5, 5, 0); |
|
@ -352,5 +358,20 @@ public class FrmMain extends JFrame { |
|
|
|
|
|
|
|
|
//RetrieveData.insertSampleData(); |
|
|
//RetrieveData.insertSampleData(); |
|
|
RetrieveData.fillList(); |
|
|
RetrieveData.fillList(); |
|
|
|
|
|
txtSearch.setText("wpisz tytuł/tagi..."); |
|
|
|
|
|
txtSearch.getDocument().addDocumentListener(new DocumentListener() { |
|
|
|
|
|
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) { |
|
|
|
|
|
RetrieveData.fillList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
|
|
RetrieveData.fillList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
|
|
RetrieveData.fillList(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |