LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-10-2004, 05:02 AM   #1
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
Java Graphics in Linux


I am new to java so don't know how to do graphics in java using the swing packages... i have instaled java sdk for linux in my Red hat linux 9... but the graphical codes of java in windows don't work in linux... why does this happens can anyone tell me....
 
Old 01-10-2004, 06:00 AM   #2
poison
Member
 
Registered: Dec 2003
Location: Layer 7 =D
Distribution: Slackware, LFS, Rock Linux
Posts: 165

Rep: Reputation: 30
they should work...
can you post some example code or post a link to let us know what exactly doesn't work ?

Last edited by poison; 01-10-2004 at 06:04 AM.
 
Old 01-10-2004, 07:09 AM   #3
jcookeman
Member
 
Registered: Jul 2003
Location: London, UK
Distribution: FreeBSD, OpenSuse, Ubuntu, RHEL
Posts: 417

Rep: Reputation: 33
You shouldn't have any problems unless you're using deprecated MS stuff.

BTW...go over to www.netbeans.org and grab their IDE, it is beautiful!
 
Old 01-11-2004, 08:52 AM   #4
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Original Poster
Rep: Reputation: 30
Ok i will check the website and seee.....
 
Old 01-11-2004, 11:17 AM   #5
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Are you trying to compile Java code with gcj? Because it compiles fine, but I've been trying to compile an imported class (javax.swing....) which has JOptionPane ( a graphical dialog box ) and it returns an error... no problems under Sun's j2sdk with javac compiler though...
 
Old 02-07-2004, 01:57 PM   #6
dublinclontarf
Member
 
Registered: Jan 2004
Location: dublin ireland
Distribution: Ubuntu PPC
Posts: 39

Rep: Reputation: 15
difficulties using images

hey there, i have been having difficulty getting my java programs to use images such as gif or jpg.
Im using slackware9.1 j2sdk 1.4.2, & netbeans 3.5
ive been trying to get images to display in my GUI but no luck.whats even more strange is that it worked on windows. here is the example code.

Icon jim= new ImageIcon("PHOTO.JPEG");
JLabel jimLabel=new JLabel();

jimLabel.setIcon(jim);


jimLabel.setBounds(30,240,150,200);
contentPane.add(jimLabel);

the same sort of thing happened to me when i was using mandrake too.
another thing thats strange is the image will load up in the title bar using...
setIconImage(Toolkit.getDefaultToolkit().createImage
(Imigration.class.getResource("PHOTO.JPEG")));

whats happening here & how can i get around it?
 
Old 02-07-2004, 02:05 PM   #7
rmanocha
Member
 
Registered: Oct 2003
Location: Austin,TX
Distribution: Debian SID-->fully content-->Love APT,kernel 2.6.4
Posts: 327

Rep: Reputation: 30
Quote:
Originally posted by jcookeman
You shouldn't have any problems unless you're using deprecated MS stuff.

BTW...go over to www.netbeans.org and grab their IDE, it is beautiful!
i have not used netbeans yet but i have use BlueJ and i think it is the best IDE ever....at least for school work.
 
Old 02-07-2004, 05:39 PM   #8
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Hold back,start again, what is the code you are trying to use exactly? (unusual to use jpeg extention rather than jpg but beyond that)
 
Old 02-07-2004, 07:25 PM   #9
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Are you trying to run the application directly from the IDE? I mean, I use (or ratter saying, used, not anymore) DrJava (http://drjava.sourceforge.net/) it's the best IDE that I've ever used for Java. BUT, for some weird reason, all images would not run when executing the application directly from the IDE. But, If I've compiled (javac myProgram.java) and tried to run my application (java myProgram) at the console, it worked perfectly. I don't know the reason for this, but that could also be your case...
 
Old 02-08-2004, 07:42 AM   #10
dublinclontarf
Member
 
Registered: Jan 2004
Location: dublin ireland
Distribution: Ubuntu PPC
Posts: 39

Rep: Reputation: 15
Yep thats it,your right.
When you run the app from the IDE it doesn't load the images but doing it from the console does.
Thanks for that MegaMan X.
I wonder why it does that?
Ill have to ask sun that.
 
Old 02-08-2004, 10:39 AM   #11
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Cool dublinclontarf!!!

I've got tell you mate, I feel sorry that it does not work for you either. But it's kinda of a relief for me to know that there're no ghosts wandering my computer (unless there're some ghosts at your machine too) lol.

I've tried to find an explanation for it on the net, but I was unsuccessful. If you ever find it, please let me know .

Thanks for the reply as well

Cheers!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JAVA: Graphics problem z24561 Programming 1 10-28-2005 10:37 PM
graphics with java simcox1 Mandriva 3 04-02-2005 11:55 AM
JAVA:(jwstric2) Problems in JAVA-LINUX nedian123 Programming 1 06-28-2004 04:12 PM
java Graphics[2D] requires an X server? Cand1e Programming 12 02-18-2004 07:18 AM
Linux and Java + Java Media Framework (JMF) perry Programming 0 11-03-2003 10:08 AM


All times are GMT -5. The time now is 08:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration