package ksiazka.kucharska;
|
|
|
|
import java.awt.BorderLayout;
|
|
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.border.EmptyBorder;
|
|
import javax.swing.JLabel;
|
|
import javax.swing.JTextPane;
|
|
import javax.swing.border.LineBorder;
|
|
import java.awt.SystemColor;
|
|
import javax.swing.JTextField;
|
|
import javax.swing.JButton;
|
|
import java.awt.event.ActionListener;
|
|
import java.awt.event.ActionEvent;
|
|
|
|
public class FrmAdd extends JFrame {
|
|
|
|
/**
|
|
*
|
|
*/
|
|
private static final long serialVersionUID = -9040508421093717296L;
|
|
private JPanel contentPane;
|
|
private JTextField txtTitle;
|
|
private JTextField txtTags;
|
|
|
|
|
|
/**
|
|
* Create the frame.
|
|
*/
|
|
public FrmAdd() {
|
|
setResizable(false);
|
|
setTitle("Dodaj przepis");
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
setBounds(100, 100, 576, 526);
|
|
contentPane = new JPanel();
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
setContentPane(contentPane);
|
|
contentPane.setLayout(null);
|
|
|
|
JLabel lblTitle = new JLabel("Nazwa przepisu:");
|
|
lblTitle.setBounds(22, 12, 119, 19);
|
|
contentPane.add(lblTitle);
|
|
|
|
JLabel lblIngredients = new JLabel("Składniki (jeden na linię):");
|
|
lblIngredients.setBounds(22, 44, 186, 19);
|
|
contentPane.add(lblIngredients);
|
|
|
|
JLabel lblDescription = new JLabel("Opis przygotowania:");
|
|
lblDescription.setBounds(22, 208, 158, 15);
|
|
contentPane.add(lblDescription);
|
|
|
|
JLabel lblOptionalImg = new JLabel("Opcjonalna grafika:");
|
|
lblOptionalImg.setBounds(397, 62, 149, 23);
|
|
contentPane.add(lblOptionalImg);
|
|
|
|
JLabel lblTags = new JLabel("Tagi (oddziel spacją):");
|
|
lblTags.setBounds(22, 443, 158, 15);
|
|
contentPane.add(lblTags);
|
|
|
|
JTextPane txtIngredients = new JTextPane();
|
|
txtIngredients.setEditable(false);
|
|
txtIngredients.setBounds(22, 70, 324, 126);
|
|
contentPane.add(txtIngredients);
|
|
|
|
JLabel imgRecipe = new JLabel("");
|
|
imgRecipe.setBorder(new LineBorder(SystemColor.textHighlightText));
|
|
imgRecipe.setBounds(382, 97, 164, 126);
|
|
contentPane.add(imgRecipe);
|
|
|
|
JTextPane txtDescription = new JTextPane();
|
|
txtDescription.setEditable(false);
|
|
txtDescription.setBounds(22, 235, 324, 196);
|
|
contentPane.add(txtDescription);
|
|
|
|
txtTitle = new JTextField();
|
|
txtTitle.setBounds(159, 12, 187, 19);
|
|
contentPane.add(txtTitle);
|
|
txtTitle.setColumns(10);
|
|
|
|
txtTags = new JTextField();
|
|
txtTags.setColumns(10);
|
|
txtTags.setBounds(22, 465, 324, 19);
|
|
contentPane.add(txtTags);
|
|
|
|
JButton btnLoad = new JButton("Wczytaj");
|
|
btnLoad.setBounds(417, 247, 102, 25);
|
|
contentPane.add(btnLoad);
|
|
|
|
JButton btnSave = new JButton("Zapisz");
|
|
btnSave.setBounds(417, 406, 102, 25);
|
|
contentPane.add(btnSave);
|
|
|
|
JButton btnCancel = new JButton("Anuluj");
|
|
btnCancel.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
setVisible(false);
|
|
}
|
|
});
|
|
btnCancel.setBounds(417, 438, 102, 25);
|
|
contentPane.add(btnCancel);
|
|
}
|
|
}
|