Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2346efc4
Commit
2346efc4
authored
Jan 12, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java table column reordering disabled
parent
90ebf8a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
java/jpwr/jop/src/GeTable.java
java/jpwr/jop/src/GeTable.java
+19
-5
No files found.
java/jpwr/jop/src/GeTable.java
View file @
2346efc4
...
@@ -63,19 +63,28 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
...
@@ -63,19 +63,28 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
this
.
hRow
=
hRow
;
this
.
hRow
=
hRow
;
this
.
hColumn
=
hColumn
;
this
.
hColumn
=
hColumn
;
table
=
new
JTable
(
rows
,
columns
-
hColumn
);
table
=
new
JTable
(
rows
,
columns
-
hColumn
)
{
public
boolean
isCellEditable
(
int
row
,
int
col
)
{
return
false
;
}
};
table
.
setColumnSelectionAllowed
(
false
);
table
.
setColumnSelectionAllowed
(
false
);
table
.
setRowSelectionAllowed
(
false
);
table
.
setRowSelectionAllowed
(
false
);
table
.
getSelectionModel
().
setSelectionMode
(
ListSelectionModel
.
SINGLE_SELECTION
);
table
.
getSelectionModel
().
setSelectionMode
(
ListSelectionModel
.
SINGLE_SELECTION
);
table
.
getColumnModel
().
getSelectionModel
().
setSelectionMode
(
ListSelectionModel
.
SINGLE_SELECTION
);
table
.
getColumnModel
().
getSelectionModel
().
setSelectionMode
(
ListSelectionModel
.
SINGLE_SELECTION
);
if
(
hRow
==
0
)
{
if
(
hRow
==
0
)
table
.
setTableHeader
(
null
);
table
.
setTableHeader
(
null
);
}
else
table
.
getTableHeader
().
setReorderingAllowed
(
false
);
if
(
hColumn
==
1
)
{
if
(
hColumn
==
1
)
{
// Set up the header column
// Set up the header column
headerColumn
=
new
JTable
(
rows
,
1
);
headerColumn
=
new
JTable
(
rows
,
1
)
{
public
boolean
isCellEditable
(
int
row
,
int
col
)
{
return
false
;
}
};
table
.
setSelectionModel
(
headerColumn
.
getSelectionModel
());
table
.
setSelectionModel
(
headerColumn
.
getSelectionModel
());
headerColumn
.
setMaximumSize
(
new
Dimension
(
90
,
10000
));
headerColumn
.
setMaximumSize
(
new
Dimension
(
90
,
10000
));
...
@@ -134,8 +143,13 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
...
@@ -134,8 +143,13 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public
void
setFont
(
Font
font
)
{
public
void
setFont
(
Font
font
)
{
if
(
table
!=
null
)
if
(
table
!=
null
)
table
.
setFont
(
font
);
table
.
setFont
(
font
);
if
(
hColumn
==
1
&&
headerColumn
!=
null
)
if
(
hColumn
==
1
&&
headerColumn
!=
null
)
{
headerColumn
.
setFont
(
font
);
headerColumn
.
setFont
(
font
);
if
(
hRow
==
1
)
headerColumn
.
getTableHeader
().
setFont
(
font
);
}
if
(
hRow
==
1
)
table
.
getTableHeader
().
setFont
(
font
);
}
}
public
void
setValueAt
(
String
value
,
int
row
,
int
column
)
{
public
void
setValueAt
(
String
value
,
int
row
,
int
column
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment