Browse Source

Test wypełniania komponentów

master
Grzegorz 10 years ago
parent
commit
2e5d90964b
2 changed files with 15 additions and 2 deletions
  1. +1
    -0
      .classpath
  2. +14
    -2
      src/main/java/ksiazka/kucharska/FrmMain.java

+ 1
- 0
.classpath View File

@ -24,5 +24,6 @@
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/> <classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
<classpathentry kind="lib" path="forms-1.3.0.jar" sourcepath="forms-1.3.0-src.zip"/> <classpathentry kind="lib" path="forms-1.3.0.jar" sourcepath="forms-1.3.0-src.zip"/>
<classpathentry kind="lib" path="D:/Documents and Settings/kozak/Pulpit/sqlite-jdbc-3.7.2.jar" sourcepath="D:/Documents and Settings/kozak/Pulpit/sqlite-jdbc-3.7.2-javadoc.jar"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

+ 14
- 2
src/main/java/ksiazka/kucharska/FrmMain.java View File

@ -6,6 +6,7 @@ import java.awt.BorderLayout;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.DefaultListModel;
import javax.swing.JSplitPane; import javax.swing.JSplitPane;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JTextField; import javax.swing.JTextField;
@ -21,6 +22,7 @@ import javax.swing.border.LineBorder;
import java.awt.SystemColor; import java.awt.SystemColor;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import ksiazka.kucharska.retrieveTest;
public class FrmMain extends JFrame { public class FrmMain extends JFrame {
@ -41,6 +43,8 @@ public class FrmMain extends JFrame {
private JButton btnDelRecipe; private JButton btnDelRecipe;
private JButton btnLoadImg; private JButton btnLoadImg;
private JLabel lblRecipeTitle; private JLabel lblRecipeTitle;
private static DefaultListModel recipesListModel;
void DeactivateAddMenu() { void DeactivateAddMenu() {
btnCancel.setVisible(false); btnCancel.setVisible(false);
@ -67,11 +71,17 @@ public class FrmMain extends JFrame {
txtTags.setEditable(true); txtTags.setEditable(true);
lblRecipeTitle.setVisible(false); lblRecipeTitle.setVisible(false);
} }
public static DefaultListModel getRecipesList()
{
return recipesListModel;
}
/** /**
* Create the frame. * Create the frame.
*/ */
public FrmMain() {
public FrmMain() {
setResizable(false); setResizable(false);
setTitle("Książka Kucharska v1.0"); setTitle("Książka Kucharska v1.0");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -115,7 +125,8 @@ public class FrmMain extends JFrame {
gbc_btnSearch.gridy = 0; gbc_btnSearch.gridy = 0;
panel.add(btnSearch, gbc_btnSearch); panel.add(btnSearch, gbc_btnSearch);
JList recipesList = new JList();
recipesListModel = new DefaultListModel();
JList recipesList = new JList(recipesListModel);
GridBagConstraints gbc_recipesList = new GridBagConstraints(); GridBagConstraints gbc_recipesList = new GridBagConstraints();
gbc_recipesList.insets = new Insets(0, 0, 5, 0); gbc_recipesList.insets = new Insets(0, 0, 5, 0);
gbc_recipesList.gridwidth = 2; gbc_recipesList.gridwidth = 2;
@ -219,5 +230,6 @@ public class FrmMain extends JFrame {
btnCancel.setBounds(319, 46, 117, 25); btnCancel.setBounds(319, 46, 117, 25);
panel_2.add(btnCancel); panel_2.add(btnCancel);
retrieveTest.retrieveData();
} }
} }

Loading…
Cancel
Save