286 Posted Topics

Member Avatar for Jessurider

you could try html in the code like so [CODE] String str; str="<html>IT s1s2 <h1>26</h1></html>"; [/CODE] That will change the size to make it a header, but I do not know how to set the size in html. I'm sure you could find it.

Member Avatar for Jessurider
0
102
Member Avatar for GENGIS

If all else fails try buying a new hard drive and reinstalling windows to that or borrowing a working hard drive and booting to that.

Member Avatar for sirlink99
0
87
Member Avatar for Farhad.idrees

you could also use [CODE]Math.random ();[/CODE] and then compare the generated number to if statements, each of which contain one option.

Member Avatar for sirlink99
0
183
Member Avatar for sirlink99

I am wondering if it is possible to access the windows explorer in Java. For selecting files to open, or a destination to save something (a picture for example).

Member Avatar for Ezzaral
0
182
Member Avatar for harinath_2007

make sure your image is exactly like in windows. instead of [CODE]JLabel img=new JLabel(new ImageIcon("d:/myproject/image1.jpg"));[/CODE] try this [CODE]JLabel img=new JLabel(new ImageIcon("D:\\myproject\\image1.jpg"));[/CODE]

Member Avatar for NormR1
0
124
Member Avatar for Dhanesh10

[QUOTE=jackmaverick1;1598149]I've never actually used it, but there seems to be a swing class for your purposes. Just Google something like JCalendar, and you should be set. ...THOUGH I MAY BE WRONG!! :-)[/QUOTE] There seem to be many third party softwares that supply a [URL="http://www.java2s.com/Product/Java/Swing/Calendar-Date-Time.htm"]calendar[/URL], but I could not find one …

Member Avatar for jackmaverick1
0
135
Member Avatar for willywhomperz

you could use a vector that stores strings and then compare the current word to the words in the vector and if the word already appears then you don't increase the count while if the word does not appear you add it to the vector and increase the word count

Member Avatar for NormR1
0
274
Member Avatar for sirlink99

I am wondering if there is an easier way to check if the mouse is in a rectangle. Currently I am using an if statement like so [CODE] if (mX > rectX && mX < rectX + 20 && mY > rectY && my < rectY + 10){ } // …

Member Avatar for sirlink99
0
102
Member Avatar for sirlink99

I have just started making a new program. I barely have any code, and when I load it the frame is clear for like 20 seconds and then it loads what goes into the frame. why does it take so long to load? I have another code that I tested …

Member Avatar for mKorbel
0
2K
Member Avatar for jamd200

I made one for physics class, except mine gives out values and then you need to add the colors onto the resistor. download it here: [url]http://www.mediafire.com/?6r9pzn4y1wdmd14[/url] I left out the tolerance on mine That is the whole library (at least as much as we got done) that I uploaded. Give …

Member Avatar for jamd200
0
7K
Member Avatar for sirlink99

I am trying to read a custom file extension When reading a string from the file it output the correct string, however when I attempt to read an int it does not output the correct int. Here is my code: [CODE] import java.awt.event.*; import java.awt.*; import java.io.BufferedReader; import java.io.FileInputStream; import …

Member Avatar for NormR1
0
276
Member Avatar for xhalcyon

It seems like you did this thinking that you could use the command prompt, however applets a web based programs, so there is no command prompt there. use JTextField(s) to get input and JLabel(s) to output things. use the basic layout for applets: [CODE] import javax.swing,*; import java.awt.event.*; import java.awt.*; …

Member Avatar for sirlink99
0
107
Member Avatar for sirlink99

I have this key listener in my application, and it wont work. This is my first key listener in an application, however I have done a mouse listener in one before. Anyway here is my code: [CODE] import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.*; public class DropGame extends JPanel …

Member Avatar for sirlink99
0
521
Member Avatar for PHIPH

I used Ready to program (a really crappy IDE). you cannot mistype anything, it doesn't show you corrections. I suggest you use that, just for the compiling, it is Java 1.4 though. You could use it for the basics. Like I said just use it for the built in compiler. …

Member Avatar for jwenting
0
182
Member Avatar for sirlink99

Hello. I am trying to make a program that has a menu. When you click play , it should (for now) output the text "In Game". It does that. However, it prints the text on a new JFrame. I would like it to print it on the same frame. How …

Member Avatar for sirlink99
0
132
Member Avatar for sirlink99

I have a menu that I made, and the first time you select a program prom the menubar and click the launch button it launches the program, however when you select a different program, or to to the menu and reselect the same program then click launch it opens 2 …

Member Avatar for sirlink99
0
116
Member Avatar for sirlink99

I have a check button and I was wondering how to get the value from it. When I use this code it gives me that it is selected always, even when it is not. [CODE] public void itemStateChanged(ItemEvent e) { // TODO Auto-generated method stub JCheckBox sourceBox = ((JCheckBox)e.getSource()); wave1Invert …

Member Avatar for sirlink99
0
122
Member Avatar for sirlink99

I have this code here [CODE] public void actionPerformed(ActionEvent arg0) { for (int i = 0; i <= 360; i++){ for (int z = 0; z < 9; z++){ xaxisWave1 [z][i] -= 1; if (xaxisWave1[z][360] < 0){ System.out.println("Line out"); for (int y = 0; y <= 360; y ++){ xaxisWave1[z][y] …

Member Avatar for sirlink99
0
160
Member Avatar for sirlink99

I have two JSliders that are both going to a common stateChanged Method, but I am having trouble separating them. I assumes they were somewhat like separating something in the actionPerformed method, but it doesn't seem to work. it does however go into the method, it is just the if …

Member Avatar for sirlink99
0
127
Member Avatar for sirlink99

I have several different classes and they have graphics in them. I told java to repaint in a class class called LongitudinalWaveGraphics, but it repaints a class called ResistorCCGraphics. Why is this? Thanks for the help. if you need any codes then I can post them.

Member Avatar for NormR1
0
342
Member Avatar for aguele

you could also go to school or just volunteer at a place where they design software.

Member Avatar for sirlink99
0
122
Member Avatar for jl.lakhnai

if it is an application your IDE may provide an export as executable jar file option (I know eclipse does), or you can use a program called [URL="http://www.syncedit.com/software/javalauncher/"]Java Launcher[/URL], which converts your applications into exes. If it is an applet then you cannot convert it into an exe.

Member Avatar for turt2live
0
171
Member Avatar for sirlink99

How would I go about using swing components and graphics in the same program. Whenever I seem to add a swing component my graphics disappear. Please help. Thanks. My main Class [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ResistorColorCodeProgram implements MouseMotionListener, MouseListener, KeyListener{ public ResistorColorCodeProgram (){ JFrame resistorCCFrame …

Member Avatar for mKorbel
0
204
Member Avatar for matadori

you can use the jpanel.remove(component); Statement and it will remove the component from the JPanel.

Member Avatar for mKorbel
0
2K
Member Avatar for atoivan

I suggest you first draw a picture, then figure out what numbers you need, then replicate the picture in java. then expand it to take user input and still calculate the correct answer.

Member Avatar for jon.kiparsky
-1
119
Member Avatar for sirlink99

I have this part of my code. I have a JLabel and a JButton that are in a panel. The I place that panel into another panel that has a border layout and I set the panel containing the label and button to be "NORTH", but the JLabel does not …

Member Avatar for Ezzaral
0
934
Member Avatar for sirlink99

is it possible to incorporate a class file that is written in applet into a JLabel in application? I know it is possible to put HTML code in a JLabel, so I copied the code from my html file created when I compile and run the applet. I put it …

Member Avatar for mKorbel
0
105
Member Avatar for sirlink99

I have never heard of it. I am researching on how to implement the internet to my program and I come across it. it seems to be easier then what I was trying to do for the past while. Could someone please link me to a website that can provide …

Member Avatar for ceyesuma
0
217
Member Avatar for sirlink99

I am working if application and I cannot figure out how to make a box move forward one at a time when the spacebar is pressed. Here are my codes: [CODE] package DrawingInApplications; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.*; import javax.swing.JFrame; public class Program extends Drawing implements KeyListener{ Drawing d; …

Member Avatar for JamesCherrill
0
994
Member Avatar for sirlink99

I am tying to use Gridbag layout, but I cannot seem to get it working. [URL="http://img703.imageshack.us/img703/1461/photo00002y.jpg"]here[/URL] is the plan. and here is the code: [CODE] import java.awt.event.*; import java.awt.*; import javax.swing.*; import java.net.*; import java.nio.*; public class Chatroom implements ActionListener { public Chatroom (){ JFrame frame = new JFrame ("Warrior …

Member Avatar for mKorbel
0
171
Member Avatar for sirlink99

I have a general idea on how to start. I would need a gui with a screen to display the text and a JTextField to write the text and a send button. I would also need to import the java.new package to connect between the computers, but other then that …

Member Avatar for Majestics
0
111
Member Avatar for jeffmummey@sbcg

Applets are java programs that are required to run in web browsers. Applications are java programs that can act as a stand alone program, and can be converted in exe's and executable jar files. You can only run applications using the command prompt. Applets have to be integrated into websites.

Member Avatar for sirlink99
0
169
Member Avatar for sirlink99

Is it possible to communicate with java to a usb that has been converted into an antenna, that sends and recieves signals to/from a remote controlled car?

Member Avatar for sirlink99
0
89
Member Avatar for sirlink99

I am trying to sense multiple keys at a time and I am wondering how to use a hash map to do this.

Member Avatar for mKorbel
0
146
Member Avatar for sirlink99

I am wondering if I could write this code to a file and then print it at a starting location (like an image). [CODE] g.setColor(Color.white); g.fill3DRect(en1X + 0 * enZ, en1Y - 25 * enZ, 5 * enZ, 5 * enZ, true); g.fill3DRect(en1X + 5 * enZ, en1Y - 30 …

Member Avatar for mKorbel
0
201
Member Avatar for rjdelight

you add it under the code at line 103. and if at the top of the code you type [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; [/CODE] then you don't need to write out a bunch of extra code every single time you use a JFrame, JPanel, JLabel, JButton, etc.

Member Avatar for sirlink99
0
3K
Member Avatar for sirlink99

Is there a way to diplay a web page like google in an application in a JLabel for example. Kind of like the new minecraft launcher where it shows the update in a window about the login area. Thanks for any help.

Member Avatar for mKorbel
0
78
Member Avatar for ekin5683
Member Avatar for mKorbel
0
437
Member Avatar for sirlink99

Does anyone know of or have a website where you can upload your applets and other people can play them? (like kongregate for flash games) and maybe even make some money every time someone plays your game? If you're wondering why, I need money for school. 0.o

Member Avatar for javanoob101
0
135
Member Avatar for sirlink99

I have this code, when run, it is terribly unorganized. It looks like this: [Label Here] [Button Here] [-----TextField Here ----] [invisible Label][Button] my program does this: when something is entered in the JTextField and then you click the [Button Here] then it prints what you printed in the [invisible …

Member Avatar for sirlink99
0
7K
Member Avatar for loveu

I am attempting to make a web browser and that is the bookmarks that I am attempting to write to txt files.

Member Avatar for sirlink99
0
804
Member Avatar for kubiak

We do not give out codes here. This site is for learning. Please show us what you have so far and we may decide to help you.

Member Avatar for kubiak
0
56
Member Avatar for Taimoor Rana

1. Make a timer with a delay of 1 [CODE]Timer timer = new Timer (1,this);[/CODE](make sure to implement ActionPerformed). 2. Make a start and Stop JButton and a JLabel. 3. add actionlisteners to the buttons [CODE]startButtonName.addActionListener (this);[/CODE] and program them to start and stop the timer. 4. make a double …

Member Avatar for sirlink99
0
101
Member Avatar for McCurry0x77

you can make it an exe file using java launcher then using Paypal you can upload it and make it available for purchase or download. Or you can upload it to a site like Megaupload and make some cash while distributing your game for free.

Member Avatar for sirlink99
0
195
Member Avatar for sirlink99

I have two graphics methods in my program. One for the menu and one for the game. I have previously written all of my code in one graphics with a bunch of nested ifs. Now I am trying to separate the two. Is there a way to call the gameGraphics …

Member Avatar for sirlink99
0
458
Member Avatar for sirlink99

I have a little problem with my if statement. I have a code where I am comparing if a sprite has moved far enough for another one to generate behind it. Here it is (the dots are choped out code): [CODE]if (unit > 0) { if (moved > speed + …

0
85
Member Avatar for sirlink99

I am having some trouble with the coding for the api. games4j.com has all of the codes and files, but when I insert the api codes into my doe I get an error. Please help me. I am getting the error with these two lines [CODE]loggedIn = Highscore.isLoggedIn(applet);[/CODE] and [CODE]Highscore.save(applet, …

Member Avatar for sirlink99
0
191
Member Avatar for sirlink99

Hello I would like to implement multiple swing timers, each of which have a different function, but I cannot seem to separate the functions. I have one actionlistener and I cannot make another one. Please help.

Member Avatar for mKorbel
0
587
Member Avatar for sirlink99

Is there anywhere I can buy or some way that I can disassemble a usb device so that I can build a circuit or something on it. I would like to get the part that you plug into a computer and build a motor speed control circuit on it possible …

Member Avatar for sirlink99
0
144
Member Avatar for sirlink99

This is a very simple timer and I cant seem to get it to work I have tried this () runs but does nothing: [code] // The "Timer" class. import java.applet.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Timer extends Applet implements ActionListener { // Place instance variables here …

Member Avatar for javanoob101
0
890

The End.