Results 1 to 7 of 7
Thread: Java Projects
- 01-02-2012, 12:56 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 49
- Rep Power
- 0
Java Projects
I am working on a visual basic game where I have text and pictures with buttons to click on options. I decided to start doing this in Java as well, but ran into a problem of not being able to add images. I've spent almost twelve hours total trying to overcome this, with no avail. So I'm thinking that visual basic must be a lot easier to make games and visual oriented programs. So what is Java good at? I understand that Java does a lot under the hood with a lot of different machines.
Since I am stuck with creating a text based rpg in Java, I was wondering about making some other program such as a business application. However I'm having trouble coming up with any ideas.
Does anyone have a good idea for a Java project for beginners that would use Java as intended, instead of doing something such as programming a hangman game?
- 01-02-2012, 10:16 AM #2
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
Re: Java Projects
try a catalog of products with prices , ofers and staff
- 01-03-2012, 01:50 AM #3
Re: Java Projects
It really isn't hard to work with images in java. You can load images with ImageIO, you can display them with JFrames and Panels, and there is built in support for manipulation and multiple formats. You spent 12 hours trying to get an image to display on the screen?
Java Code:import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; public class ImageShower{ public static void main(String[] args){ new ImageShower(); } public BufferedImage img; public ImageShower(){ try { img = ImageIO.read(new File("McChris.png")); } catch (IOException e) { e.printStackTrace(); } JFrame window = new JFrame(); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyPanel myPanel = new MyPanel(); myPanel.setPreferredSize(new Dimension(img.getWidth(), img.getHeight())); window.add(myPanel); window.pack(); window.setVisible(true); } class MyPanel extends JPanel{ public void paintComponent(Graphics g){ super.paintComponent(g); g.drawImage(img, 0, 0, null); } } }
-
Re: Java Projects
- 01-03-2012, 03:21 AM #5
Member
- Join Date
- Nov 2011
- Posts
- 49
- Rep Power
- 0
Re: Java Projects
quad64bit...thanks for the help. I will try that code out tomorrow. Yes, I spent twelve hours over the course of two days trying to figure this out. I'm new to Java and all the tutorials and google searches really didn't help me out. I hope this does the trick.
Thanks again!!!
- 01-03-2012, 04:50 AM #6
Re: Java Projects
No problem, I can give you a lot more if you're more specific. You can do animations and all kinds of cool stuff!
- 01-03-2012, 05:14 AM #7
Senior Member
- Join Date
- Mar 2011
- Posts
- 171
- Rep Power
- 0
Similar Threads
-
Java Projects
By yiweiang in forum New To JavaReplies: 2Last Post: 12-15-2011, 01:28 AM -
Projects in Java
By Gousia in forum Threads and SynchronizationReplies: 18Last Post: 04-21-2011, 11:58 AM -
Java projects
By srishti in forum Java SoftwareReplies: 4Last Post: 10-04-2009, 09:02 AM -
Library JAR projects and including them in other projects
By bmelloni in forum EclipseReplies: 2Last Post: 04-03-2009, 03:03 PM -
Java Projects
By Zeke886 in forum New To JavaReplies: 0Last Post: 11-14-2007, 08:41 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks