comp.lang.java.help
  Home FAQ Contact Sign in
comp.lang.java.help only
 
Advanced search
July 2008
motuwethfrsasuw
 123456 27
78910111213 28
14151617181920 29
21222324252627 30
28293031    31
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.java.help Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Creating dynamic double dimensional arrays.         


Author: Noops
Date: Jul 9, 2008 20:42

Hi,

I am trying to create a double dimensional array of Objects.

Object arr[][];

What I want it that I wish to be able to populate this array later in
a nested for loop.
I don't know the size of row or column of the multidimentional array
at the time of declaration.

Is there any way I could do it?

Thanks for all the help.
2 Comments
  using ResultSet.getObject(int) to populate an Object[][] array         


Author: thufir
Date: Jul 9, 2008 20:28

I had to futz around with i,j to get the rows double array to match the
db table, but it's quasi-acceptable.

It was enough of a PITA that I'm sure there's a better way. To start
with, I hard coded the number of rows (9). I suppose I could iterate the
result to find the size, but then I'm iterating twice.

There's gotta be a better way. Suggestions please on how to get data
from a flat table :)

It's going to end up in a TableList for a JTable.

Whenever I look into stuff like this I see get huge results on Hibernate,
things like that which are too much right now. I'm hoping/assuming
there's something built into the API to achieve this, but a bit slicker.

thufir@arrakis:~$
thufir@arrakis:~$ cat NetBeansProjects/mysql/src/a00720398/model/
Model.java
package a00720398.model;
Show full article (2.25Kb)
2 Comments
  getting a row of data from a db table         


Author: thufir
Date: Jul 9, 2008 16:36

Looking at:

http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html#getArray
(int)

would it make sense to apply that to the init() method with an Array of
Array, Object[][] or similar, representing the data?

There's a small tweaking with indexes, but that seems best. What's the
"standard" way of grabbing that data? Or, is it that for my purposes a
kludge would be sufficient, then as I learn more I'd do it totally
differently?

thufir@arrakis:~$
thufir@arrakis:~$ cat NetBeansProjects/mysql/src/a00720398/model/
Model.java
package a00720398.model;

import a00720398.model.*;
import java.sql.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.*;
Show full article (2.02Kb)
no comments
  using HTML in JLabels         


Author: CBO
Date: Jul 9, 2008 08:12

Hi all,

I am currently devloping a java application that has a dialogue box
with a JLabel with HTML embedded into it the label. This works fine
however I want to make a section of the text a link to a file. The
problem is I am adding the code and it is recognising that I have
added a link because part of the text has turned blue and underlined
but java is not recognising it as a link that I can click on.

Any help in this matter would be highly appreciated.

Thank you
1 Comment
  How do I open a device in non-blocking mode?         


Author: Neil Cherry
Date: Jul 9, 2008 07:41

I'm a little stuck. I have a Linux device (a character device, like a
serial port) called /dev/cm15a0. I can't use RXTXcomm as it doesn't
recognize the device (and I'm having trouble recompile RXTX). I need
to open the device in non-blocking mode and read and write bytes
to/from the device. Any pointers?

--
Linux Home Automation Neil Cherry ncherry@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
Author of: Linux Smart Homes For Dummies
1 Comment