Jump to content

Sniffy

Members
  • Posts

    403
  • Joined

  • Last visited

About Sniffy

  • Birthday 06/17/1908

Contact Methods

  • MSN
    sniffygerbil@hotmail.com
  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Canada
  • Interests
    Java<br />Astronomy

Sniffy's Achievements

Member

Member (2/7)

1

Reputation

  1. Hey everyone, it is just me stopping in again to say "hi". I kind of forgot about this forum when I started getting into Java and object oriented programming in general. I am on my way to success in programming, messing with OpenGL bindings like Xith3D and JMonkey. I came across C# being able to make web applications with ASP.NET in a book that I was reading. If I look into it more, this forum just may be of some use to me once again.
  2. Sniffy

    Where are you?

    Neat web appletw3schools is global
  3. you have a cool.avatar

  4. I thank you for all of the help you've given me with PHP and MySQL and I would recommend you to other users.

  5. Also, here is another one of my past creations:aApplet.java import javax.swing.*;import java.awt.*;public class aApplet extends JApplet{ Container con = getContentPane(); String speech = " Duis nec lectus. Etiam aliquet, nulla non elementum"; String speech2 = "aliquam,libero urna rhoncus eros, vel luctus"; String speech3 = "tellus urna at mauris. Sed tincidunt consequat"; String speech4 = "erat. Nulla facilisi. Cras varius. Suspendisse"; String speech5 = "posuere turpis ac sem. Phasellus vulputate"; String speech6 = "commodo lacus.\n Sed auctor. Aliquam venenatis"; String speech7 = "tellus eget dolor. Sed risus."; public void start(){ repaint(); } public void paint(Graphics gr){ gr.drawRoundRect(9, 9, 301, 151, 20, 20); gr.setColor(Color.CYAN); gr.fillRoundRect(10, 10, 300, 150, 20, 20); gr.setColor(Color.BLACK); gr.drawString(speech, 20, 25); gr.drawString(speech2, 20, 40); gr.drawString(speech3, 20, 55); gr.drawString(speech4, 20, 70); gr.drawString(speech5, 20, 85); gr.drawString(speech6, 20, 100); gr.drawString(speech7, 20, 115); gr.fillRect(40, 140, 200, 10); }}
  6. Does anyone have a tutorial on nested classes, I've been meaning to look into it.
  7. Check out my latest creation.... do you like it?Instructions:Install SDK: http://java.sun.comCreate new file: ExampleJFrame.javaInsert Code: import javax.swing.*;import java.awt.*;import java.awt.event.*;public class ExampleJFrame{ public static void main(String[] args) { JButton press = new JButton("Show"); JButton press2 = new JButton("Hide"); JButton press3 = new JButton("Clear"); final JFrame frame = new JFrame("Example"); JFrame frame2 = new JFrame("Menu"); frame.setSize(200, 200); frame.setResizable(false); frame.getContentPane().setLayout(new FlowLayout()); frame.show(); frame2.setLocation(200, 0); frame2.setResizable(false); frame2.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { System.exit(0); } }); frame2.setSize(200, 200); frame2.getContentPane().setLayout(new FlowLayout()); frame2.getContentPane().add(press); frame2.getContentPane().add(press2); frame2.getContentPane().add(press3); frame2.show(); press.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frame.setVisible(true); } }); press2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frame.setVisible(false); frame.getContentPane().add(new JLabel("" + frame.getLocation())); } }); press3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frame.setVisible(false); frame.getContentPane().removeAll(); frame.setVisible(true); } }); } } Command Prompt: OpenType commands:javac ExampleJFrame.javajava ExampleJFrame.javaWhat do you think?What it does:Use the "Menu" frame to either "Show", "Hide", or "Clear" the JFrame "frame2" of content. Content is added each time "frame2" is shown. It displays its current location (x,y) on the screen with the java.awt.Point class.somethings wrong with my PC so i can't supply a preview at the moment
  8. Sniffy

    Java Applets

    Yes, that's what i'm aiming for, a chat program when I complete basic and intermediate courses.StringBuffer[] msg = new StringBuffer[30]; for(int x = 0; x < msg.length; x++) msg[x] = new StringBuffer("");
  9. Sniffy

    JApplet Game

    Hello, I've been working on an applet that is supposed to be a "Catch the Clown" style game. When the user clicks on the button, a new random location is set and the score is incremented. Anyways, I can't get the setLocation() method to work for my JButton, any help?It might have something to do with the FlowLayout object because FlowLayout sorts Components in rows, but I don't know what other alternatives I can use. I just need to get to know JComponents and JApplets (methods) more so help would be appreciated. /** * @(#)appletGame.java * * * @author * @version 1.00 2007/3/3 */import java.awt.*;import java.awt.event.*;import javax.swing.*;public class appletGame extends JApplet implements ActionListener { Container con = getContentPane(); JButton press = new JButton("Press"); int score = 0; JLabel dispScore = new JLabel("Score:" + score); public void init() { con.add(dispScore); con.add(press); press.setLocation(10, 10); press.setLocation(100, 100); press.addActionListener(this); con.setLayout(new FlowLayout()); } public void actionPerformed(ActionEvent e) { int locationX = (int) Math.round(Math.random()*300); int locationY = (int) Math.round(Math.random()*300); score++; dispScore.setText("Score: " + score); press.setLocation(locationX, locationY); } }
  10. On the column where it shows all of the user entries, it would be great to say who it was submitted by.Test by Sniffy^^Something like that
  11. http://www.aspnetguy.com/portfolio.htmlI've noticed that when I press the "quote" slider button, the logo and navigation go slightly out of alignment.
  12. I started at Piczo as well... go figure....
  13. The menu links aren't that great.Change it to a black with no text-decoration, and add an underline when the user hovers over one of the links.
×
×
  • Create New...