Maven dołącza do JAR'a niezbędne zależności.
Poprawki w kodzie
This commit is contained in:
94
pom.xml
94
pom.xml
@@ -8,41 +8,14 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>ksiazka-kucharska</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<url>http://git.pioder.pl/index.php/p/ksiazka-kucharska</url>
|
||||
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>${jdk.version}</source>
|
||||
<target>${jdk.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>ksiazka.kucharska.App</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
@@ -56,4 +29,65 @@
|
||||
<version>3.7.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>.</directory>
|
||||
<includes>
|
||||
<include>no_img_recipe.jpg</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>${jdk.version}</source>
|
||||
<target>${jdk.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>ksiazka.kucharska.App</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>attached</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>ksiazka.kucharska.App</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
@@ -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");
|
||||
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