f



How to disable moving(rearrange) the columns in a JTable?

How to disable rearrange the columns in a JTable?
Thank you on your help
6
Tux
10/22/2004 10:58:04 PM
comp.lang.java.gui 8286 articles. 0 followers. Post Follow

1 Replies
20864 Views

Similar Articles

[PageSpeed] 23

"Tux" <mario_zupan@inet.hr> wrote in message
news:clc33i$ivg$1@sunce.iskon.hr...
> How to disable rearrange the columns in a JTable?
> Thank you on your help

yourJTable.getTableHeader().setReorderingAllowed(false)

-- 
Mike W



27
VisionSet
10/22/2004 11:46:47 PM
Reply:

Similar Artilces:

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

moving (JTable) columns
Thanks, I'm using a JTable (with headers) and I press a button and the cells are filled with data from a source I specify. I'd like the operator to be able to move the columns while data is being filled, but problems occur as the data is sent to the column where the data was (prior to a move). So if I have 2 columns with the 1st column header lastname and the 2nd column being a boolean checkbox with header brown eyes (true or false), when I switch the 2 columns, column 2 cell data SHOULD be lastname and column one SHOULD be checkbox (true or false), but its just the opposite (p...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Cla...

Moving columns in JTable
How do you prevent someone from moving columns (the order of columns) in a Jtable by dragging them. I remember there is a means ot prevent users from doing this, but I cannot find it. Thanks, Ike Ike wrote: > How do you prevent someone from moving columns (the order of columns) in a > Jtable by dragging them. I remember there is a means ot prevent users from > doing this, but I cannot find it. Thanks, Ike > > Call setReorderingAllowed(false) on the TableHeader. BK ...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

Moving Objects Java GUI
Hi everyone, I have currently created a widget wich displays a map. Now I want to run robots on that map. I have created robot widget wich implement the runnable interface and so in a thread move forward, backward, ... . But now my question is, is there a way to do this without threads ? The reason why : GameEngine --> Sends info about robot to GUI --- Robot moves on map --- (***) Engine calculates new things <--- The problem now is that in the (***) thing the robot moves but because it's a thread the rest of the application goes further on (p...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

JTable
Having trouble disabling the "feature" of movement/repositioning Columns in a JTable. I can find the method to stop "resizing" the Column width, but I also would like the Columns to stay in a stationary position and not be abled to be repositioned within in the JTable. Using JDK 1.3.1. Thanks for you help. Ken getTableHeader().setReorderingAllowed(false) does it. "Ken Smith" <krs119@psu.edu> schrieb im Newsbeitrag news:booms7$18os$1@f04n12.cac.psu.edu... > Having trouble disabling the "feature" of movement/repositioning Columns in >...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

Learn about Gui.Lang.Java in series
In this website to learn more about Java and web Combination of Asp. 1. How to connect Java to web { xml,JavaScript}. 2. How to connect Asp to Web {xml,Ado.net,J2ee} The connection and web config is very important to Java and web with using Asp Dot Net. If you want connections more Information below links http://freejavaprogbooks.blogspot.com http://learnaboutweb.blogspot.com http://ganesh-freedotnetbooks1.blogspot.com On Jul 26, 12:22=A0am, Gani <ganeshkumar...@gmail.com> wrote: > In this website ... =2E.. What? ...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type o...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-so...

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) My CLASSPATH includes: jdom.jar xerces.jar jython.jar jt400.jar log4j-1.2.8.jar commons-httpclient-2.0.jar When I just try to perform the import statements from example code I get the error pasted below....

[JTable]JTable in Jtable
I am trying to set a JTable with some JTables in the second column. I have gone quite far but I am now facing a bug when adding a line with a selection active in the the column where I have JTables embedded. Column 0 is standard. How I proceed for cells of column 1: - in cells I put a JPane containing the header and the Table as it is the only possibility to display the header when not using a JScrollPane (my choice). - I customize Cell and Renderer to properly display my Header and Table that I extract from the embedded JPanels objects as built in colomn 1. - I do a few trick...

Newbie: Is there a way to stop JTable columns from moving?
Hello. I'm just beginning with Java. Can you help? Is there something I can do to make it impossible for the user to mess around with the order of the columns. It's just that I find it annoying that the columns can be moved when there's absolutely no use for it! I've looked in the Java tutorial and in the Java Class Reference and found nothing about it. Thanks. > I'm just beginning with Java. Can you help? Is there something I can > do to make it impossible for the user to mess around with the order of > the columns. It's just that I find it annoying that th...

Moving columns below other columns, in a matrix
Hi everyone! Say I have a 6x6 matrix - what is the easiest way of moving the rightmost 3 columns below the leftmost 3 columns, such that the matrix becomes 12x3? Thanks for any help! On May 5, 3:51=A0pm, "Catalin Eberhardt" <longtal...@gmail.com> wrote: > Hi everyone! > > Say I have a 6x6 matrix - what is the easiest way of moving the rightmost= 3 columns below the leftmost 3 columns, such that the matrix becomes 12x3? > > Thanks for any help! A =3D magic(6); B =3D [A(:,1:3);A(:,4:6)] or: B =3D [reshape(A(:,1:3:end),[],1) reshape(A(:,2:3:...

bbrowser2 rightclick caption disable column move
Hi in bbrowser2, it seems that rightclick on the caption ALSO triggers the ability to move the column if the mouse right button is held down for a short period. it has been this way for the left mouse button which is fine. thus if the column caption has a context menu, then whilst this is shown, this seems to count towards the delay, and once the menu has been closed (by selecting an item or whatever) the column is now waiting to be moved. how can i disable the right click enabling the column move ? regards richard t-r Maybe "oDCBrowser:EnableColumnMove(FALSE)&qu...

java program in java GUI
folks I am writing a java GUI that calls other java programs i want to execute java command line options in back ground. I am using java exec command this is part of code Runtime.getRuntime().exec("/root/java/jdk1.5.0_06/bin/java /root/Desktop/project/SAXXMLHandler"); where i want to run SAXXMLHandler java file But i dont get any output thanks CSUIDL PROGRAMMEr wrote: > folks > I am writing a java GUI that calls other java programs > i want to execute java command line options in back ground. I am using > java exec command > this is part of code > >...

general java GUI question : what is latest&greatest java GUI technology to front a mysql applications
(apologies up front if question is too broad or too dumb) I have intermediate java/mysql programming experience and want to take this up a notch and study java+mysql with a view to creating a database application for GUI programming currently I can see books on swing, JSP, JSF ..... its all a bit confusing as each work with JDBC but each are vastly different WRT how they construct a GUI I want to learn a java GUI technology that I can use to sit on top of a mysql database, typical tasks would be -o- form to read data into database (using many html controls -> text boxes, radio buttons, d...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Presetting column width in JTable without disabling autoresize?
Hi! Is there any way to preset column width in pixels wihtout disabling auto resize in JTable? Here is my situation: 1. The first column of the table needs to be preset to 30 pixels. 2. I don't want horizontal a scrollbar to appear. 3. I cannot use TableColumn.setMaxWidth, because I want user to be able to resize column sizes. TableColumn.setPreferredWidth doesn't work here, the table increases the width of my column anyway. Please help! Regards, Anton On 3/22/2005 at 7:45:32 AM, Anton Golovko wrote: > Is there any way to preset column width in pixels wihtout disabling > ...

Exception when hiding a column in JTable using Java version 1.3
We trigger the hide/show of columns in a JTable from a JPopupMenu displayed on a right mouse button click. When the hide column menu option is selected we call the TableColumnModel.removeColumn(TableColumn) function and an exception is thrown. The same code works with no problems in Java version 1.2 The exception is as follows: Exception occurred during event dispatching: java.lang.ArrayIndexOutOfBoundsException: -1 < 0 at java.util.Vector.elementAt(Vector.java:422) at javax.swing.table.DefaultTableColumnModel.getColumn(DefaultTableColumnModel.java:271) at javax.swing.plaf.basic.Basic...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

Web resources about - How to disable moving(rearrange) the columns in a JTable? - comp.lang.java.gui

All sizes - When we were not around our table, people would rearrange the stickers - Flickr - Photo Sharing ...
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Parties rearrange cards to gain the advantage
Mark Latham signed up Kim Beazley and Peter Garrett, two recognised national figures, as he girds for the federal election. - Sydney Morning ...

BHP Billiton slashes dividend, rearranges top execs amid a dire first-half result
... and axed some top executives after slumping to a $US5.7 billion first-half net loss. BHP Billiton has more than halved its dividend and rearranged ...

U.S. Debt Ceiling 2012: Treasury Dept. To Rearrange Books In Scheme To Avoid Spending Limit
WASHINGTON (AP) The U.S. Treasury Department will begin taking steps this week to delay hitting the government's $16.4 trillion borrowing limit. ...

How-To: Rearrange and hide Apple TV channels to personalize and declutter your home screen
... arrangement on your Apple TV similarly to your other iOS devices. While you cannot explicitly delete channels from your Apple TV, you can rearrange ...

Diving into M: You can now rearrange and delete quick settings
Now that the keynote is over and the day is winding down a bit, I have time to play around with Android M as much as my heart demands (well... ...

New Pebble firmware lets you control music volume, rearrange apps in launcher
... Palo Alto, Calif., to a Pebble smartwatch near you, and version 2.2 brings a couple of welcome improvements. First up is that you can now rearrange ...

Is Apple Already Preparing To Rearrange Your Living Room?
... Apple TV will be right back. What would you pay to have Apple in your living room? Source: MacRumors Is Apple Already Preparing To Rearrange ...

New study rearranges family tree of birds
... put some species in close proximity that some in the field found surprising. Now, a new paper is out with a different approach—it rearranges ...

VW rearranges leadership as brand focuses on electrification
Filed under: Design/Style , Green , Hirings/Firings/Layoffs , Porsche , Volkswagen Volkswagen reorganizes the executive suite, putting Porsche ...

Resources last updated: 2/23/2016 1:15:23 PM