Problem updating JTable
Hi,
The code below only works if this.jTable1.setModel has not been called earlier during runtime.
When it fails, the jTable simply does not update the displayed data.
all.tableModel1.addColumn();
this.jTable1.setModel(all.tableModel1);
this.jTable1.repaint();What's the problem here? How do I perform a more "thorough" update?
Regards,
Pingen
What's the problem here? How do I perform a more "thorough" update?I have no idea what you are trying to do based on the 3 lines of code you posted.
If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
http://homepage1.nifty.com/algafield/sscce.html
Don't forget to use the "Code Formatting Tags", so the posted code retains its original formatting.
http://forum.java.sun.com/help.jspa?sec=formatting
Similar Messages
-
Could You help Please (updating JTable Content)
Sorry for posting again... I really need help... can't update the content of JTable instead it keep adding the columns to the table. How can I remove before add?? I tried couple of things but didn't work...
Please help... bellow is the code i posted on the previous message...
Hi,
How can I remove the content of my table columns before adding the new data?
here is the code the fillout the table everytime the new data is available..
public void FillOutTables()
m_data.setTableData();
jTable1.setAutoCreateColumnsFromModel(false);
jTable1.setModel(m_data);
for (int k = 0; k <AppLetterTableData.m_columns.length; k++)
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setHorizontalAlignment(AppLetterTableData.m_columns[k].m_alignment);
TableColumn column = new TableColumn(k, AppLetterTableData.m_columns[k].m_width, renderer, null);
jTable1.addColumn(column);
JTableHeader header = jTable1.getTableHeader();
header.setUpdateTableInRealTime(false);
how should I clean the table before adding? should I clean the table or the dataClass (AppLetterTableData) allthough I clear the vector with in the data class (AppLetterTableData) before I add to it.
Very much appreciate your helpI guess I solved the problem but JTable.setValueat(Object value, row, column)
thanx for not responding:) -
Hi,
I have encountered a problem with JTable, i am trying to display some 15 columns and their values , one of the columns value is null, then the JTable is not displaying its value from this column(which is with null value) onwards.
Can anybody assiss me in this matter.
Regards
khiz_engI don't know If I can fix your problem, but
I know just that it works on my PC.... It's very very
slow... I don't know how to insert PageSetUp option... I have to study the problem.....
However I don't think it's a hard problem....
I want ask to you if you have found some problems when you are in Editing mode in a cell.....
in the jdk1.2 version I could save while was in editing mode using the editingStopped method.
It permit to update all data .... also the data in the cell I was editing.
in the jdk 1.3 if I use this method It doesn't work properly... It maybe destroy the content object in the Cell..... because I'm able to print all the table except the editing cell (it throw an exception...)
What's changed????
I don't know...
Can u help me? -
Clear and update JTable.
Hi. this is a follow up from [Original Tread in "New To Java"|http://forums.sun.com/thread.jspa?messageID=10886612�]
Hope you can help me here. For you who dont read the link. This application is build only to lay up here. So the Layout aint pretty. It compiles and run tho. What i want and cant get to work is to reload table when i push my JTabbedPane.
Main Class
package test;
import javax.swing.*;
import javax.swing.event.*;
public class Main {
public Main() {
run();
public void run(){
frame();
// clear and update JTable in class three
public void clearThree() {
Three t = new Three();
t.clearVector();
public JFrame frame() {
JFrame frame = new JFrame();
JTabbedPane tab = new JTabbedPane();
tab.addTab("two",new Two());
tab.addTab("three", new Three());
tab.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
clearThree();// this dont work
frame.add(tab);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800,400);
frame.setVisible(true);
frame.pack();
return frame;
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run(){
new Main();
}// class two
package test;
import java.awt.event.*;
import java.util.Vector;
import javax.swing.*;
// class twoś only purpose is to call clear() in class Three
public class Two extends JPanel{
public Two(){
toolBar();
public void clearThree () {
Three t = new Three();
t.clearVector();
public void toolBar(){
JToolBar bar = new JToolBar();
JButton button = new JButton("clear");
button.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent e){
clearThree(); // this dont work
bar.add(button);
add(bar);
}// class three hold the table.
package test;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
public class Three extends JPanel{
DefaultTableModel model;
JTable table;
Vector v = new Vector();
Vector a = new Vector();
Vector<Vector> r = new Vector<Vector>();
public Three() {
jBar();
jTable();
public void clearVector(){
v.removeAllElements();
a.removeAllElements();
r.removeAllElements();
model.fireTableDataChanged();
public void jBar() {
JToolBar bar = new JToolBar();
JButton button = new JButton("clear");
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
clearVector();// this does work
bar.add(button);
add(bar);
public JScrollPane jTable(){
v.addElement("ID");
v.addElement("Name");
a.addElement("01");
a.addElement("Magnus");
r.add(a);
model = new DefaultTableModel(r,v);
table = new JTable(model);
JScrollPane pane = new JScrollPane(table);
add(pane);
return pane;
}Thank you for your replay, I have taken all of your tips and modifed my original application. but the problem is still there. This has been a very messy thread. and it is becouse i thougth it were a table/model problem. But itś not. In the code below I have a JTextField. When i push the JTabbedPanes i want the setText(); to kick in. this compile and run.
// class One
package test;
import javax.swing.*;
import javax.swing.event.*;
public class Main {
public Main() {
run();
public void run(){
frame();
public JFrame frame() {
JTabbedPane tab = new JTabbedPane();
final Three t = new Three();
JFrame frame = new JFrame();
JPanel panel = new JPanel();
tab.addTab("two",new Two());
tab.addTab("three", new Three());
tab.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
t.setText(); // should call setText() in class Three.
frame.add(panel);
frame.add(tab);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800,400);
frame.setVisible(true);
frame.pack();
return frame;
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run(){
new Main();
}class Two. Does nothing more then holding an empty tab
package test;
import javax.swing.*;
public class Two extends JPanel{
public Two(){
emptyPane();
public void emptyPane () {
JLabel label = new JLabel("Just an empty JTabbedPane");
add(label);
}class Three
package test;
import javax.swing.*;
public class Three extends JPanel{
JTextField text;
public Three() {
text();
public void setText() {
text.setText("Hello"); // this piece of code i want to insert in my JTextField
validate(); // when i push the JTabbedPanes.
repaint();
updateUI();
public JTextField text(){
JToolBar bar = new JToolBar();
text = new JTextField("",20);
bar.add(text);
add(bar);
return text;
} -
Posted the entire text from the error window, when trying to update, using the normal NON-TECHIE way to update any and all Adobe CC products, via the Creative Cloud updater installed when Adobe Creative Cloud subscription was purchased when first offered.
The following occurs, ad nauseam:
There was a problem updating InDesign CC
For more information see the specific error below.
Update Failed
Download error. Press Retry to try again or contact customer support.(49)
Here's the crux of my frustration:
(1) Customer Service is NOT contact-able, to receive LIVE help.
(2) There is NO way for me to mitigate this "Download error", being a student learning InDesign, and NOT in any way capable of tweaking folders/files here and there.
Therefore, the real question:
Given that a significant number of subscribers are having the above referenced issue with attempting to download the current update for InDesign, WHAT ARE WE SUPPOSED TO DO, in order to get our contractually paid-for updates to our legally and contractually paid-for Adobe software, specifically in my case, InDesgin's current update?
Please, NO TECHNICAL mumbo-jumbo which most likely will cause the overwhelming majority of users, like me, to seriously corrupt their computer files, but rather an honest, straightforward "what to do" from real CS/Engineers working for Adobe, as to how to FIX this issue, period.
===========================================================
UPDATE:
Here is a way in which I think I was able to "update" my InDesign CC application:
(1) Sign-In to your Adobe Account
https://www.adobe.com/
(2) Click on the MENU icon
(3) Click on the product InDesign icon
Your browser should display the page for Adobe InDesign CC
https://www.adobe.com/products/indesign.html?promoid=KLXLU
(4) Click on the Download icon,
Your browser should now display the page to download InDesign,
https://creative.adobe.com/products/download/indesign
(5) a Pop-Up window should open, and display:
Launch Application
This link needs to be opened with an application.
with the first option to select being the CreativeCloud(URIHandler)
(5) Select this application and click OK.
What happened when I followed steps (1) thorugh (5) is that:
(a) InDesign CC(2014) was installed,
(b) InDesign CC, updated, and then
(c) InDesign CC(2014), also updated.
Why this all worked, is a mystery to me.
Looks like a separate, "new" version of InDesign, InDesign CC(2014), was installed, the existing "old" InDesign was updated, and then the newly installed Indesign CC(2014) was further updated.
A BIT MORE, when I launched my InDesign CC app, and checked to see if there were Updates Available, there in fact was an Adobe InDesign CC 64 bit (9.2.2) update.
I clicked on UPDATE and my "old" InDesign CC app was "successfully updated."
FURTHER INFO: I may have neglected to list some important info ... OS: Windows 8.1 Pro with Media Center, 64-bit
Confused, I am able to launch BOTH of these apps, and hopefully I may use one of these versions of the InDesign CC app, to do some InDesign work.
Will keep y'all posted!
Message was edited by: Richard Yapkowitz, about an hour after I first posted this issue.Jackdan error 49 indicates the installer was unable to access a critical file or directory. You can find additional details at Error downloading Creative Cloud applications - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html.
-
Problem with JTable in a JScrollPane
Hello all,
I have a problem using JTable, that the number of columns is very big,
and the JScrollPane shows only vertical ScrollBar, isn't there any way to show a horizontal ScrollBar, to show the other columns without being bunched.
Thanks in advance.table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
-
problem updating to iphoto 9.6 after upgrading to Yoesmite I am getting the following message when I try top date iPhoto This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or canc
"This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." ?
This error message will appear erraneously, if you skipped the update to Mavericks and iPhoto 9.5.1 and went straight from an earlier MacOS X version to Yosemite, without first updating to iPhoto 9.5.1 and associating iPhoto to your AppleID.
Try first to buy iPhoto with your AppleID instead of updating. Delete iPhoto from Applications, but don't empty the Trash, then go to the main page of the App Store and search for iPhoto. If you are lucky, it will show as free and you can buy it directly.
If iPhoto is not showing as free, there is no help but contacting the App Store Support: Ask for a redemption code. You will need to provide a prove of purchase for your mac with iPhoto preinstalled.
http://www.apple.com/support/mac/app-store/contact/ -
I am having a problem updating itunes to the latest version on my windows xp i get the error message 126 and the banner that says this application has failed because MSVCR80.dll was not found. anyone have a fix suggestion? thanks
Click here and follow the instructions.
(98724) -
Hi There
Am having a big problem updating my iphone 4 Apps, due to a problem with my password for my apple id. But it seems that i have two different ids, one for the updates and another for the downloads. I am not able to retrieve my Id password for updating my Apps. Can you help me ps?
Thank youWhat program did you use to fix the internal hard drive? What repairs did it report making? More crucially, if repairs were reported, did you re-run the utility until it reported no problems found? It's possible for one set of problems with a drive to mask others.
If you have about 5GB or so free space on the internal hard drive, you can use your OS X Install disc to perform an Archive and Install to recover from the failed Software Update. When the computer restarts, download and run the OS X Update Combo 10.4.11 (Universal). When the Mac restarts after that, run Software Update. During all this, make sure nothing interrupts or shuts down the Mac! Note that the first start after each of these updates will take significantly longer than subsequent starts, so be very patient.
How did you back up your internal drive to the external one? Did you just drag things over in the Finder, or did you use a utility such as SuperDuper! or CarbonCopyCloner? Does the external HD show up as a bootable volume in System Preferences > Startup Disk, or using Startup Manager? -
BRFplus: Problem updating values in an internal table in a loop expression
Hi
I'm looking into the loop expression type of BRFplus and I have come across a problem updating an internal table, I'm trying to create and populate the table using a loop, here is the functionality I'm trying to achieve:
In a rule set create an internal MONTH_TBL table containing 12 rows of two columns: MONTH_NUM containing values 1 through 12 and MONTH_VAL containing an amount (initially 0,00 EUR in all 12 rows).
After initializing the table traverse through SFLIGHT table and for each row add PRICE from the table to MONTH_VAL in the row of MONTH_TBL corresponding to the month of FLDATE field in SFLIGHT.
The initialization of MONTH_TBL works as intended, as does the traversal of and retrieval of values from SFLIGHT. The problem however is the update of the internal table MONTH_TBL (defined as result data object for the function). I don't get an error, but the tables does not get updated, and I cannot seem to find out what the problem is. I would have attached an XML extract of the function + ruleset for information, but it dosen't seem like that is possible, I could e-mail it on request (for SAP employees with access to system QU5 the function is LOOP_TEST in application Z_KLAUS_TEST).
I hope that this is sufficient information to understand the issue that I'm dealing with.
best regards
Klaus Stenbæk, KMDHi Klaus,
The Loop expression is part of NW 7.02 which is not yet released. When you experience the problem as part of a test you should have a contact at SAP for dealing with problems/errors. Usually SAP-internal messages are used for this purpose. Please clarify with your SAP contact how the model is.
BR,
Carsten -
Hello,
i have a selection problem with JTable. I want to allow only single cell selection and additionally limit the selection to the first column.
I preffered the style from MS Outlook Express where you can select the email accounts to edit.
It is a table like this:
Account name | Type | ...
--------------|---------|---------------------
Hotmail | POP3 |
GMX | IMAP |The selection should be only avaibable at 'Hotmail' or 'GMX' - not at 'POP3', 'IMAP' or as complete row selection.
Please help me!
Thanks.
WarlockMaybe this will helpimport java.awt.*;
import javax.swing.*;
public class Test3 extends JFrame {
public Test3() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = getContentPane();
String[] head = {"One", "Two"};
String[][] data = {{"R1-C1", "R1-C2"}, {"R2-C1", "R2-C2"}};
JTable jt = new JTable(data, head);
jt.getColumnModel().setSelectionModel(new MyTableSelectionModel());
content.add(new JScrollPane(jt), BorderLayout.CENTER);
jt.setCellSelectionEnabled(true);
jt.setRowSelectionAllowed(false);
jt.setColumnSelectionAllowed(false);
setSize(300, 300);
setVisible(true);
public static void main(String[] arghs) { new Test3(); }
class MyTableSelectionModel extends DefaultListSelectionModel {
public void setSelectionInterval(int index0, int index1) {
super.setSelectionInterval(0, 0);
} -
Problems updating ipod touch 3g to os 5
Hi... I am very excited to see what all the buzz is about for the new OS 5.x for use on my ipod touch 3g but im having problems updating my device. my itunes has been updated to 10.5 and i have conected my touch to my computer and clicked on update. but all that comes back is that it is updated to the newest version which it states 4.2.1 .... but i dont see any of the new stuff that is supposed to be with os 5 i have erased and put my touch back to default settings and it still does the same thing. i erased using itunes when connected by the cord and i have tried using the reset feature on the touch itself w/o the cable. if anyone has some advice for me it would be greatly appreciated !!
heather from gravenhurst wrote:
it is an 8g & ive talked to the itunes support team and they say that it is indeed a 3g
Not true. Apple did not make an 8GB ipod touhc 3rd gen at all. They do not exist.
You can see for yourself:
Identifying iPod models -
Problem updating Nokia N97 firmware over the arir ...
OK here goes,
I'm having some real problems updating the firmware on my white nokia N97
I recently bought it of the web as a 12 month contract onto t-mobile (not there website though) in th uk
After noticing some problems i googled and noticed a firmware update had been released on 1st july 2009
I tried to get the firmwae over the air (OTA) via typing in *#0000# and selecting check for updates. I get no updates available for nokia and t-mobile (unsure what the difference is?)
So i heard try using nokia software updater.
i downloaded latest version 1.6.13 and installed it on a windows vista 32-bit home premium laptop ok
i have also installed all of the stuff that came with the cd with the phone (ovistore etc )
when i plug the phone into the laptop i get four options (PC, media, usb and something else) first time it ran it installed the necessary drivers and so therefore when i now plug it it just connects as expected.
so the laptop is detecting the nokia n97 at this stage
when i then load nokia software updater click next i put the phone into general mode on full charge with a sim card in it and click next again to detect the phone is pc suite mode
after about 2 minutes it says it can detect the phone although i can go to my computer and traverse the folder view!
i can even set it off looking for the phone pluggin it in and the autoplay options of vista will kick in in the background detecting the phone (ie outisde scope of nokia software updater)
i have tried all different connections mode pc suite mode etc different profiles nothing. tried it onto different pcs with different windows version on it. tried reinstalling software updater
my software version is 10.0.012 and my product code is 0587240
interestingly when i goto the can i update on nokias website it says no i have the latest version when i supply this information. weird
im kinda in catch 22 because there is a bug with pc usb detection of the phone in version 10 but i cant update to version 11 because of this bug
its driving me nuts any help greatly appreciated
thanks in advance
Cheers
kylekyletindle wrote:
i did a hard reset using *#7370# and locking code 12345 and the phone did reset but software updater does still not recognise the phone whilst ovi suite does and nokia sync etc
to make matters worse it has broke my facebook app error: undefined
mega
just what i wanted cheers nokia
It will break your facebook as you have re-formatted the C: drive of you phone. Was you facebook installed to the E: drive by any chance?
Go to OVI Store and re-install it.
It may be work installing it from OVI Store then un-installing that one to clean off the mess you have been left with post formatt and then re-installing it fresh from OVI Store.
As I always say. Before doing a re-format always uninstall all apps/widgests before doing a hard reset or factory reset.
I also do a this and a factory reset before firmware updates to clean my phone. Should really do a hard reset/format as this would be cleaner still, but tehn I would have to do a lot more set-up afterwards.
N97 (Product Code: 0585262 (Voda UK)) FW 12.0.026
95 8Gb (Product Code: 0558787 (UK)) FW 31.0.018
If a post by a user has been helpful, please click on the Kudos! button. -
I have problems updating my apps in appstore for my IPad. How should i update it using itunes? I'm unable to see all the apps currently.
Hallo. If all of your apps purchases from the same Apple ID, you can try to update them on iTunes, ways as below:
iTunes 12 for Windows: Download previous purchases from the iTunes Store
iTunes 12 for Mac: Download previous purchases from the iTunes Store
Regards,
Anson -
I am having problems updating my itunes to the latest version, on each stage I am getting a message 'The feature you are trying to use in on a network resource that is unavailable.' I try to click OK it fails and I do not know an alternate path to select, please help?
I get message like below on each stage of the update, Quicktime, Safari & iTunes;
It's so annoying as until I update my iTunes account my phone won't sync.Many thanks for the screenshot. (The key to these is knowing which particular .msi file is being mentioned by the message.)
(1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
http://majorgeeks.com/download.php?det=4459
(2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
(3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
(4) In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove", as per the following screenshot:
(5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?
(Assuming that the QuickTime and Safari messages were also citing bonjour64.msi, you should also then be good to go with those installs too.)
Maybe you are looking for
-
Hi all, I created a query with customer exit variable that is filled from another variable manual entry. When i start a query I receive this error message: Error for variable in the customer exit and in debug I find this message: System error in the
-
Problem in adding vales to service contract line item
I want the OBJECT ID field to be filled in OBJECT LIST tab at item level when ever a service product is entered in service contract ( new line item) automatically ... I tired wiht CRM_ORDERADM_I_MERGE (CRM_ORDERADM_I_BADI) and CRM_ORDERADM_I_MERG
-
Confusion with Template Div and insertion of text
Here's my problem: When editing my template, when inserting text into the center div box (The main one, center column), the text defaults to italics, or it is inserted, indented and bold. I want it to be normal default font, without indentation so I
-
Loading an external clip(swf) and removing existing one
Hi All, I am tearing my hair out; I simply want a button when clicked, to load an external swf. But I just can't seem to get my head around it. Here is my code: butt1_btn.addEventListener(MouseEvent.CLICK, swf1); function swf1(evt:MouseEvent):void lo
-
Need Help, iTunes not reading iPod.
I have had this 160GB iPod since October of 07 and it has worked perfectly...until last night...it just stopped playing any of my songs and just kept on changing to the next song looking for one that would play. I tried restoring it but I guess somet