打包成可执行jar。并删除无效的代码

master
zhanghai 2 years ago
parent a662cf5068
commit e1915db378

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -74,6 +74,32 @@
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
<!-- 使用maven-shade-plugin插件打包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer44
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.docus.sw.fenpan.MyApplication</mainClass>
</transformer44>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

@ -113,6 +113,7 @@ public class FenpanService {
File sourceFile = new File(piece.getAbsolutePath());
File[] files = sourceFile.listFiles();
for (File file : files) {
//非图片模式,跳过。
try {
ImageInfo imageInfo = Imaging.getImageInfo(file);
int height = imageInfo.getHeight();

@ -1,45 +0,0 @@
package com.docus.sw.fenpan;
import javax.swing.*;
import java.awt.*;
/**
* @author EdwinD
* @create 2020.08.19 08:31
* @desc Swing
**/
public class JFrameDemo1 {
public static void main(String[] args) {
new JFrameDemo1().init();
}
// init()初始化。
public void init() {
JFrame jFrame = new JFrame("这是我们的JFrame窗口。");
jFrame.setVisible(true);
jFrame.setBackground(Color.BLUE);
jFrame.setBounds(100, 100, 1024, 900);
jFrame.setLayout(new FlowLayout());
Panel panel2 = new Panel();
panel2.setLayout(new FlowLayout());
JLabel jl=new JLabel();
jl.setBounds(10,50,500,300);
JTextField jtf =new JTextField();
jtf.setBounds(10,10,150,30);
panel2.add(jtf);
JButton jButton2 = new JButton("启动");
panel2.add(jButton2);
jFrame.add(panel2);
// 关闭事件
jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}

@ -1,38 +0,0 @@
package com.docus.sw.fenpan;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
import java.awt.*;
public class MainJFrame extends JFrame {
public void init(){
JFrame jFrame = new JFrame("这是我们的JFrame窗口。");
jFrame.setVisible(true);
jFrame.setBackground(Color.BLUE);
jFrame.setBounds(0, 0, 1324, 900);
MigLayout layout = new MigLayout("wrap 2");
JPanel panel = new JPanel(layout);
panel.setVisible(true);
panel.add(new JLabel("Name"));
panel.add(new JTextField(""), "growx");
panel.add(new JLabel("Age"));
panel.add(new JTextField(""), "growx");
panel.add(new JLabel("Address"));
panel.add(new JTextArea(5, 20), "growx");
panel.add(new Button("提交"));
panel.add(new Button("关闭"));
jFrame.add(panel);
// 关闭事件
jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new MainJFrame().init();
}
}

@ -1,48 +0,0 @@
package com.docus.sw.fenpan;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
public class MyJFrame extends JFrame {
JPanel center =new JPanel();
public MyJFrame()throws IOException {
init();
this.setVisible(true);
}
private void init(){
this.setSize(800,600);
this.setTitle("随机小游戏");
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(null); //设置为空布局
this.setResizable(false);
this.setBackground(Color.BLUE);
JLabel jl=new JLabel();
jl.setBounds(10,50,500,300);
JTextField jtf =new JTextField(); //文本框
jtf.setBounds(10,10,150,30);
JButton jb=new JButton("搜索"); //鼠标单击监听器
jb.setBounds(180,10,60,30);
jb.addActionListener(
(ActionListener) ->{
String text =jtf.getText();
jl.setText(text+"是个难得的人才");
});
jtf.addActionListener((ActionEvent e)->{ //常用键enter 用addActionListener
jb.doClick();
});
this.add(jl);
this.add(jtf);
this.add(jb);
}
public static void main(String[] args) throws IOException {
new MyJFrame().init();
}
}
Loading…
Cancel
Save