Maven dołącza do JAR'a niezbędne zależności.
Poprawki w kodzie
This commit is contained in:
@@ -2,9 +2,11 @@ package ksiazka.kucharska;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.LineBorder;
|
||||
@@ -33,7 +35,7 @@ public class CB_View extends JFrame{
|
||||
private JLabel lblIngredients = new JLabel("Składniki:");
|
||||
private JLabel lblDescription = new JLabel("Opis wykonania:");
|
||||
private JLabel imgRecipe = new JLabel("");
|
||||
private JLabel lblRecipeTitle = new JLabel("Nazwa przepisu");
|
||||
private JLabel lblRecipeTitle = new JLabel("Przepis");
|
||||
private JLabel lblTags = new JLabel("Tagi:");
|
||||
private JFileChooser fcImg = new JFileChooser();
|
||||
private JScrollPane scrollPane = new JScrollPane();
|
||||
@@ -61,7 +63,7 @@ public class CB_View extends JFrame{
|
||||
splitPane.setLeftComponent(panel);
|
||||
txtSearch.setBounds(5, 5, 237, 20);
|
||||
txtSearch.setColumns(10);
|
||||
scrollPane_2.setBounds(5, 30, 237, 453);
|
||||
scrollPane_2.setBounds(5, 30, 237, 448);
|
||||
|
||||
scrollPane_2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
scrollPane_2.setMaximumSize(new Dimension(100, 100));
|
||||
@@ -97,9 +99,15 @@ public class CB_View extends JFrame{
|
||||
fcImg.addChoosableFileFilter(new FileNameExtensionFilter("Pliki PNG", "png"));
|
||||
fcImg.setAcceptAllFileFilterUsed(false);
|
||||
fcImg.setFileFilter(ffAll);
|
||||
imgDefaultRecipe = new ImageIcon("no_img_recipe.jpg");
|
||||
imgRecipe.setIcon(imgDefaultRecipe);
|
||||
|
||||
try {
|
||||
BufferedImage bi = ImageIO.read(getClass().getResource("/no_img_recipe.jpg"));
|
||||
imgDefaultRecipe = new ImageIcon(bi);
|
||||
imgRecipe.setIcon(imgDefaultRecipe);
|
||||
bi.flush();
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
btnLoadImg.setVisible(false);
|
||||
|
||||
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
@@ -136,9 +144,9 @@ public class CB_View extends JFrame{
|
||||
|
||||
panel.add(txtSearch);
|
||||
panel.add(scrollPane_2);
|
||||
btnAddRecipe.setBounds(5, 486, 116, 25);
|
||||
btnAddRecipe.setBounds(5, 481, 116, 25);
|
||||
panel.add(btnAddRecipe);
|
||||
btnDelRecipe.setBounds(125, 486, 116, 25);
|
||||
btnDelRecipe.setBounds(125, 481, 116, 25);
|
||||
panel.add(btnDelRecipe);
|
||||
panel.add(txtSearch);
|
||||
panel_2.add(btnSave);
|
||||
|
||||
Reference in New Issue
Block a user