Skip to content

Commit

Permalink
添加GUI界面
Browse files Browse the repository at this point in the history
  • Loading branch information
Wen Chen (陈文)-云数据中心集团 committed Sep 10, 2019
1 parent 0f79e46 commit 203c0b9
Show file tree
Hide file tree
Showing 10 changed files with 686 additions and 54 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
hs_err_pid*
.idea

/target/
97 changes: 54 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>tony</groupId>
<artifactId>hideImage</artifactId>
<version>1.0-SNAPSHOT</version>

<name>hideImage</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencies>
</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>tony.ImageHide</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>

</archive>
<classesDirectory>
</classesDirectory>
</configuration>
</plugin>

</plugins>
</pluginManagement>
</build>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>tony</groupId>
<artifactId>hideImage</artifactId>
<version>1.0-SNAPSHOT</version>

<name>hideImage</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>tony.HiJFrame</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
<classesDirectory>
</classesDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding><!-- 指定编码格式,否则在DOS下运行mvn compile命令时会出现莫名的错误,因为系统默认使用GBK编码 -->
</configuration>
</plugin>

</plugins>
</pluginManagement>
</build>
</project>
54 changes: 54 additions & 0 deletions src/main/java/tony/AboutFrame.form
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>

<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="290" max="-2" attributes="0"/>
<EmptySpace pref="18" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="88" max="-2" attributes="0"/>
<EmptySpace pref="33" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="&#x5b8b;&#x4f53;" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;body&gt;&#x672c;APP&#x53ef;&#x5b9e;&#x73b0;&#x56fe;&#x7247;&#x9690;&#x5199;&#x529f;&#x80fd;&#xff0c;&#x5c06;&#x6587;&#x672c;&#x5199;&#x5165;PNG&#x56fe;&#x7247;&#x4e2d;&#x4e14;&#x4e0d;&#x5f71;&#x54cd;&#x56fe;&#x7247;&#x6b63;&#x5e38;&#x4f7f;&#x7528;&#xff0c;&#x5e76;&#x4e14;&#x53ef;&#x4ee5;&#x968f;&#x65f6;&#x63d0;&#x53d6;&#x3002; &#xa;&lt;br&gt;&#x4f5c;&#x8005;&#xff1a;[email protected]&#xa;&lt;br&gt;&lt;a href=&quot;https://github.com/iminto/hideImage&quot;&gt;https://github.com/iminto/hideImage&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
</Component>
</SubComponents>
</Form>
59 changes: 59 additions & 0 deletions src/main/java/tony/AboutFrame.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package tony;

import javax.swing.JFrame;

public class AboutFrame extends javax.swing.JFrame {
public AboutFrame() {
initComponents();
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setLocationRelativeTo(null);
setTitle("关于");
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

jLabel1 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setFont(new java.awt.Font("宋体", 0, 14)); // NOI18N
jLabel1.setText("<html><body>本APP可实现图片隐写功能,将文本写入PNG图片中且不影响图片正常使用,并且可以随时提取。 \n<br>作者:[email protected]\n<br><a href=\"https://github.com/iminto/hideImage\">https://github.com/iminto/hideImage</a></body></html>");
jLabel1.setToolTipText("");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(18, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(33, Short.MAX_VALUE))
);

pack();
}// </editor-fold>//GEN-END:initComponents


public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
AboutFrame aboutFrame=new AboutFrame();
aboutFrame.setVisible(true);
aboutFrame.setTitle("关于");
aboutFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
}
});
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
// End of variables declaration//GEN-END:variables
}
Loading

0 comments on commit 203c0b9

Please sign in to comment.