Skip to content

Commit c1433b1

Browse files
committed
修改文件
1 parent 7a0d8b3 commit c1433b1

7 files changed

Lines changed: 165 additions & 8 deletions

File tree

.idea/checkstyle-idea.xml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

JavaGUI_UTF8.iml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="EclipseModuleManager">
4+
<libelement value="file://libs/commons-lang3-3.5-sources.jar" />
5+
<libelement value="file://libs/commons-lang3-3.5.jar" />
6+
<libelement value="jar://$MODULE_DIR$/libs/sqlite-jdbc-3.8.11.2.jar!/" />
7+
<src_description expected_position="0">
8+
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
9+
</src_description>
10+
</component>
11+
<component name="NewModuleRootManager">
12+
<output url="file://$MODULE_DIR$/bin" />
13+
<exclude-output />
14+
<content url="file://$MODULE_DIR$">
15+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
16+
</content>
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
<orderEntry type="inheritedJdk" />
19+
<orderEntry type="module-library">
20+
<library name="commons-lang3-3.5-sources.jar">
21+
<CLASSES>
22+
<root url="file://libs/commons-lang3-3.5-sources.jar" />
23+
</CLASSES>
24+
<JAVADOC />
25+
<SOURCES />
26+
</library>
27+
</orderEntry>
28+
<orderEntry type="module-library">
29+
<library name="commons-lang3-3.5.jar">
30+
<CLASSES>
31+
<root url="file://libs/commons-lang3-3.5.jar" />
32+
</CLASSES>
33+
<JAVADOC />
34+
<SOURCES>
35+
<root url="file://libs/commons-lang3-3.5-sources.jar" />
36+
</SOURCES>
37+
</library>
38+
</orderEntry>
39+
<orderEntry type="module-library">
40+
<library name="sqlite-jdbc-3.8.11.2.jar">
41+
<CLASSES>
42+
<root url="jar://$MODULE_DIR$/libs/sqlite-jdbc-3.8.11.2.jar!/" />
43+
</CLASSES>
44+
<JAVADOC />
45+
<SOURCES />
46+
</library>
47+
</orderEntry>
48+
</component>
49+
</module>

src/com/MainTest.java

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,44 @@
11
package com;
2-
import java.util.Arrays;
2+
import com.myblog.components.table.mergecells.gridbagtable.GridBagTable;
33

4+
import java.awt.BorderLayout;
5+
import java.awt.event.ActionEvent;
6+
import java.awt.event.ActionListener;
47

5-
public class MainTest {
8+
import javax.swing.JButton;
9+
import javax.swing.JFrame;
10+
import javax.swing.JScrollPane;
11+
import javax.swing.table.DefaultTableModel;
612

7-
/**
8-
* @param args
9-
*/
10-
public static void main(String[] args) {
11-
int[] columns = {1,2,3,4,5};
12-
System.out.println("getSelectedColumns=" + Arrays.toString(columns));
13+
14+
public class MainTest implements ActionListener {
15+
16+
private GridBagTable table;
17+
private MainTest()
18+
{
19+
JFrame d = new JFrame();
20+
DefaultTableModel model = new DefaultTableModel(5,5);
21+
22+
table = new GridBagTable(model);
23+
table.setRowHeight(20);
24+
25+
JScrollPane pane = new JScrollPane(table);
26+
d.getContentPane().add(pane, BorderLayout.CENTER);
27+
JButton btn = new JButton("合并/拆分");
28+
d.getContentPane().add(btn, BorderLayout.NORTH);
29+
btn.addActionListener(this);
30+
d.setBounds(0, 0, 400, 400);
31+
d.setVisible(true);
32+
}
33+
34+
@Override
35+
public void actionPerformed(ActionEvent e) {
36+
table.mergeCells(table.getSelectedRows(), table.getSelectedColumns());
37+
}
38+
39+
40+
public static void main(String[] fsd){
41+
new MainTest();
1342
}
1443

1544
}

0 commit comments

Comments
 (0)