From 7cf565f74e1dcbcfb06b49323a48c912137668e4 Mon Sep 17 00:00:00 2001 From: PioDer Date: Wed, 11 Jun 2014 22:26:05 +0100 Subject: [PATCH] --- .gitignore | 3 +- src/main/java/ksiazka/kucharska/FrmMain.java | 44 ++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2f7896d..c146cf5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -target/ +*/target/** + diff --git a/src/main/java/ksiazka/kucharska/FrmMain.java b/src/main/java/ksiazka/kucharska/FrmMain.java index 8314356..eac660a 100644 --- a/src/main/java/ksiazka/kucharska/FrmMain.java +++ b/src/main/java/ksiazka/kucharska/FrmMain.java @@ -9,13 +9,16 @@ import javax.swing.border.EmptyBorder; import javax.swing.JSplitPane; import javax.swing.JButton; import javax.swing.JTextField; -import java.awt.Dimension; -import javax.swing.SwingConstants; import java.awt.GridLayout; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; import javax.swing.JList; +import javax.swing.JTextPane; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.border.LineBorder; +import java.awt.SystemColor; public class FrmMain extends JFrame { @@ -30,6 +33,7 @@ public class FrmMain extends JFrame { * Create the frame. */ public FrmMain() { + setResizable(false); setTitle("Książka Kucharska v1.0"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 800, 500); @@ -65,6 +69,8 @@ public class FrmMain extends JFrame { JButton btnSearch = new JButton("Szukaj"); GridBagConstraints gbc_btnSearch = new GridBagConstraints(); + gbc_btnSearch.anchor = GridBagConstraints.NORTH; + gbc_btnSearch.fill = GridBagConstraints.HORIZONTAL; gbc_btnSearch.insets = new Insets(0, 0, 5, 0); gbc_btnSearch.gridx = 1; gbc_btnSearch.gridy = 0; @@ -82,6 +88,7 @@ public class FrmMain extends JFrame { JPanel panel_1 = new JPanel(); GridBagConstraints gbc_panel_1 = new GridBagConstraints(); gbc_panel_1.gridwidth = 2; + gbc_panel_1.gridheight = 0; gbc_panel_1.insets = new Insets(0, 0, 0, 5); gbc_panel_1.fill = GridBagConstraints.BOTH; gbc_panel_1.gridx = 0; @@ -94,6 +101,37 @@ public class FrmMain extends JFrame { JButton btnDelRecipe = new JButton("Usuń"); panel_1.add(btnDelRecipe); + + JPanel panel_2 = new JPanel(); + splitPane.setRightComponent(panel_2); + panel_2.setLayout(null); + + JTextPane textPane = new JTextPane(); + textPane.setEditable(false); + textPane.setBounds(26, 88, 228, 126); + panel_2.add(textPane); + + JTextPane textPane_1 = new JTextPane(); + textPane_1.setEditable(false); + textPane_1.setBounds(26, 254, 410, 196); + panel_2.add(textPane_1); + + JLabel lblRecipeTitle = new JLabel("Nazwa przepisu"); + lblRecipeTitle.setFont(new Font("Dialog", Font.BOLD, 18)); + lblRecipeTitle.setBounds(12, 12, 442, 22); + panel_2.add(lblRecipeTitle); + + JLabel lblIngredients = new JLabel("Składniki:"); + lblIngredients.setBounds(26, 61, 70, 15); + panel_2.add(lblIngredients); + + JLabel lblDescription = new JLabel("Opis wykonania:"); + lblDescription.setBounds(26, 227, 152, 15); + panel_2.add(lblDescription); + + JLabel lblNewLabel_3 = new JLabel(""); + lblNewLabel_3.setBorder(new LineBorder(SystemColor.textHighlightText)); + lblNewLabel_3.setBounds(272, 88, 164, 126); + panel_2.add(lblNewLabel_3); } - }