-
Posts
403 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Sniffy
-
-
Neat web appletw3schools is global
-
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); }}
-
Does anyone have a tutorial on nested classes, I've been meaning to look into it.
-
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
-
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("");
-
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); } }
-
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
-
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.
-
I started at Piczo as well... go figure....
-
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.
-
Thanks, it works.
-
User sign-up with "favorites" links in the CP would be cool.Also a suggestion center.
-
Whoa, You've been into Web-Design for quite a while. I've only been into web-design for just over a year now.Hey folks!My name's Anders and I'm a webdesigner/developer! Why else would I be here?I know - HTML (3 years) - XHTML (1 year) - CSS (2 years) - JavaScript (3 years) - PHP (2 months) - MySQL (2 months)I'm 15 years old and I turn 16 this year :)I've learned a lot at W3Schools, and you're the best :)And better, Hege and Kai Jim (don't remember more right now), well, we're all from Norway :blink:Do I have to write more about my self? Well, if I gotta, tell me -
Did it say what kind of file it was?
-
I added MU Global.
-
-
ActionScript is similar to Java, yet nonetheless like JavaScript. It really is OOP, but you can look at it like procedural programming, although for advanced programmers opening up their minds to the whole OOP thing would create a lot of possibilities in ActionScript.http://www.adobe.com/support/flash/action_...nary/index.html
-
Yeah, I was thinking it might be from a bigger script.
-
Cool.I found all seven of the sites.It's coming along great but it needs a lot more sites.
-
Is this part of the code or the full code?It looks like some sort of a reserved keyword from a script.
-
The next thing you need is a template though.No offense, but it's kind of bland.
-
-
Whoa nice, I submitted this forum to it.
-
I'm downloading NVU now to check it out.It seems to be more what I want than Scelida 2, but I'll eventually try both out.
Introduce Yourself
in General
Posted
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.