zack chancery

Ranch Hand
+ Follow
since Aug 19, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by zack chancery

I have a working copy of my project in one folder and a carbon copy in another. however it will not run due to some access issue with the FileChooser. Its and applet so why am i not surprised?
here is the run time error
any help would be great.
this project has gone on too long!
thanks
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
17 years ago
Does anyone know why if you copy all your java files including the microsoft access db file that supports the program into a different directory and run it from there, you get an access denied error like this one:


access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
java.security.AccessControlException: access denied (java.lang.RuntimePermission
accessClassInPackage.sun.jdbc.odbc)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:269)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:149
1)
at sun.applet.AppletSecurity.checkPackageAccess(AppletSecurity.java:190)

at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at Teller.<init>(Teller.java:101)
at Main.init(Main.java:19)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
java.security.AccessControlException: access denied (java.util.PropertyPermissio
n user.dir read)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:269)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
76)
at java.lang.System.getProperty(System.java:573)
at java.io.Win32FileSystem.getUserPath(Win32FileSystem.java:272)
at java.io.Win32FileSystem.resolve(Win32FileSystem.java:288)
at java.io.File.getAbsolutePath(File.java:459)
at sun.awt.shell.Win32ShellFolder2.<init>(Win32ShellFolder2.java:191)
at sun.awt.shell.Win32ShellFolder2.listFiles(Win32ShellFolder2.java:504)

at sun.awt.shell.ShellFolder.listFiles(ShellFolder.java:115)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.j
ava:189)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:245)
at javax.swing.plaf.metal.MetalFileChooserUI.updateUseShellFolder(MetalF
ileChooserUI.java:414)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFile
ChooserUI.java:304)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserU
I.java:130)
at javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserU
I.java:152)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.JFileChooser.updateUI(JFileChooser.java:1701)
at javax.swing.JFileChooser.setup(JFileChooser.java:345)
at javax.swing.JFileChooser.<init>(JFileChooser.java:320)
at javax.swing.JFileChooser.<init>(JFileChooser.java:273)
at Tracer.<init>(Tracer.java:37)
at Main.init(Main.java:22)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
Hi Jeff,
actually i am wrong in my question.
what is happening is taht i am populating the textarea by using the append method to display the results of a query. so naturally it will be scrolled down. ill try using your method.
thanks,
z
17 years ago
I have a JScrollPane that contains a JTextarea but on display it is defaulted at being scrolled down to the end meaning i have to scroll up to actually read the text. I want it to be displyed at the top naturally with the option to scroll down. not the other way around.
How can I arrange this?
thanks in advance,
z
17 years ago
Hi all,
i need to add an image to a panel but it is important it does not stretch or shrink to fit the panel as i will require the exact dimensions of the image to apply some image processing features to my GUI. How do I add the image as is?
17 years ago
pixelgrabber class
17 years ago
i know of a way to navigate across a GUI using a mouse and get the x, y coordinates as i go but how would i be able to listen for and read the RGB values of the pixel i am hovering over?
thanks in advance,
z
17 years ago
Yeah i was, thats fixed it,
Thanks Michael,
z
17 years ago
i am creating a GUI applet that consists of a JTabbedPane. On loading the applet some components of the different tabbedpanes are visible, making my applet look a total mess. I have to click on each tabbed pane individually before it sorts itself out. Has anyone else had this issue? feedback would be gratiously received.
z
17 years ago
I have a gui that uses many combo boxes in different areas and they work fine except for one particular instance when i have added it using GridBag Layout. it is presented fine at first but when clicked the options are not seen unless the mouse is moved over the area which until then is white space. Does anyone know why this occurs. I am not 100percent that the origins of this problem lie with layout manager but its the only thing i can come up with.

.
.
.
.
having tested this it seems that the layout manager is not the reason why the problem occurs. it must be due to something else. Has anyone come across this kind of thing before?
Also i found that expanding the window size causes all the components to display as white space until the gui is clicked on again.
Feedback is gratefully received.
thanks
z
[ October 05, 2004: Message edited by: zack chancery ]
17 years ago
Outstanding!!!
Thanks David,
Z
imagine i have a string variable called myString.
i want to insert the string's value into a table of my database.
i can insert fine when the string is explicit but when it is referenced there is a problem.
e.g
s.execute("INSERT INTO Table (name) VALUES ('zack')); is fine

but

s.execute("INSERT INTO Tracker (name) VALUES (myString)); is NOT fine


***ERROR***
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
***********


BEST REGARDS,
Z
Please help,
I downloaded a mySql Driver that comes in the form of a jar file called mysql-connector-java-3.0.15-ga.jar. i saved it in the jre/lib/ext dir of my j2sdk as is advised but when i try and load it in my program i get an exception. when i print the stackTrace for the exception this is returned:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:162)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at Teller.<init>(Teller.java:53)
at Main.init(Main.java:20)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.FileNotFoundException: H:\project\com\mysql\jdbc\Driver.class
(The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
.java:69)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:156)
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:274)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:149)


regards,
z
thats worked a treat. i was originally using Flowlayout (default) and the graph was most probably being drawn outside the bounds of the panel and therefore was not visible. Thanks Craig!
z
17 years ago