1,678 Posted Topics

Member Avatar for MasterGoGo

MasterGoGo. . is there any reason you're using Panel, Frame, Button, etc instead of JPanel, JFrame, JButton, etc? Reason being because I believe the latter are more up to date. As another note, variable names are by convention lowercase for the first letter, for example names that follow convention: reset, …

Member Avatar for MasterGoGo
0
212
Member Avatar for BestJewSinceJC

The important code: [CODE] Browser browser = new Browser(shell, SWT.NONE); URL url = this.getClass().getResource("/example.html"); browser.setUrl(url.toString()); shell.open(); [/CODE] P.S. I've carefully considered what Masijade and others told me in the other thread; the example.html file is located in multiple locations, including in the same directory as the .class file. . I …

Member Avatar for kvprajapati
0
417
Member Avatar for sunny.goyal

Maybe I'm not sure what you are saying. But image that you created a bunch of private JFrames in Java. Would you expect other applications to be able to get the references to those JFrames?

Member Avatar for sunny.goyal
0
202
Member Avatar for Godstryke

I'm not sure if you want to consider process different from process. or if you want to consider them the same thing. Which is it? If you create a Scanner, read in things one by one, put them into an ArrayList if they are unique words, and increment a counter …

Member Avatar for Godstryke
0
192
Member Avatar for bigbadbag33

you didn't use code tags. read the stickies. all of them. completely.

Member Avatar for VernonDozier
0
91
Member Avatar for loozax

Yeah, have your class implement the Comparable interface, then use Collections.sort(ArrayList goes here). With ints it is probably even easier than that though,.

Member Avatar for BestJewSinceJC
0
73
Member Avatar for anirudhtomer

After you set the size call frame.revalidate(). It might be frame.validate() though. If you're expecting the actual thing to resize in the netbeans editor window, you're going to be disappointed. That resizes the frame in the running application. At least I think it works, it's been awhile since I've done …

Member Avatar for BestJewSinceJC
0
56
Member Avatar for KirkPatrick

[QUOTE=KirkPatrick;869386] 1) Is it possible to add 6 columns while the last column is a drop down menu that takes care of the last 10 textfields data which would be entered upon the submit button? [/QUOTE] You can find code similar to this on the Java tutorials by looking up …

Member Avatar for KirkPatrick
0
1K
Member Avatar for malou_baby08

You compiled it and had a problem? Then post your error including the line number. .

Member Avatar for malou_baby08
0
69
Member Avatar for cmaclennan
Member Avatar for BestJewSinceJC
0
96
Member Avatar for hajjo

Netbeans is not a compiler, it is an IDE and it helps you build GUI programs in swing, so it will compile things for you but it itself is not a compiler. I don't know what bluej is (sounds familiar). edit: posted at the same time.

Member Avatar for BestJewSinceJC
0
118
Member Avatar for onindita

You didn't explain what happy vs. unhappy is. And you didn't post your code in code tags.

Member Avatar for BestJewSinceJC
0
143
Member Avatar for hell04

Use the modulus operator, %. If you type modulus in google you can learn everything you need to know about it, and you'll see why you need to use it, so I won't explain further.

Member Avatar for hell04
0
126
Member Avatar for BestJewSinceJC

edit: I see a lot of other threads on Daniweb on this. But after 2+ hours of reading about Sound in Java, I'm even more frustrated, so I have some questions. 1. Is the Java Sound API sufficient for the following operations: Playing mp3 audio files, pausing, and fast forward/rewinding …

Member Avatar for BestJewSinceJC
0
496
Member Avatar for BestJewSinceJC

[CODE=Java]URL myurl = this.getClass().getResource("/SummaryReport.rptdesign"); File file = new File(myurl.getFile()); System.out.println("Name=" + file.getAbsolutePath()); [/CODE] The above code seems to get the resource. But I guess I am going about creating a file connected to that resource wrong? Because I cannot subsequently open a FileReader connected to that file. . I am …

Member Avatar for ~s.o.s~
0
134
Member Avatar for buchanan23

Making variables global for the sake of easily doing something is usually a bad programming practice. Instead, you'd usually make get methods and set methods to get your data and to modify it.

Member Avatar for buchanan23
0
2K
Member Avatar for KirkPatrick

It also looks like you need to separate your logic into methods that each do one specific task. Right now your code is pretty hard to read and understand.

Member Avatar for BestJewSinceJC
0
718
Member Avatar for hhprado

The purpose was more than likely to do it with some sort of loop. Regardless, don't post full code solutions to entire programs.

Member Avatar for hhprado
0
164
Member Avatar for gotm

Yes. At the top of whatever method you are in, create an int variable called counter. int counter = 0; Then, whenever you go onto a new line, counter++;. If you need to use the counter in more than one method, then declare the variable as a class variable.

Member Avatar for oliver_lundag
0
361
Member Avatar for loozax

I have a feeling you wrote it in your head but didn't actually type it Masijade. Cheater! Lol.

Member Avatar for kvprajapati
0
181
Member Avatar for jds_14

A queue implementation, if you wanted to write it yourself, is simple enough that you could just start coding if you know what a queue is, so I'm thinking maybe you have a more specific question, a part of the queue implementation or a concept you don't understand?

Member Avatar for BestJewSinceJC
0
128
Member Avatar for bringoutthejams

[CODE=Java]for(int scan = index+1; scan<list.length; scan++) if(list[scan].compareTo(list[min])<0) min = scan; temp = list[min]; list[min] = list[index]; list[index] = temp;[/CODE] You need to use code tags, i.e., what I used in this post. The problem might be your use of brackets; did you mean to use brackets after the if statement?

Member Avatar for JamesCherrill
0
126
Member Avatar for kakakon

Whenever you no longer need to use an Object in Java, if you simply get rid of any references to that Object, Garbage collection will take care of it from there. Set any references to that Object to null.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Ismael_Jay

You could download a picture of a mouse and then paint that image. Or, you could always get some mice from under my stove - I think that's where they're all hiding.

Member Avatar for Ismael_Jay
0
88
Member Avatar for K?!

To confirm his opinion: ShawnCPlus is absolutely correct. You'd be wise to follow his advice.

Member Avatar for BestJewSinceJC
0
138
Member Avatar for BestJewSinceJC

After a little research I discovered some Calendar methods that were pretty nice. [CODE=Java]Date date = new Date(); int daysSinceSeen = - ( rand.nextInt() % 365 ); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, daysSinceSeen);[/CODE] How could this code be returning a date in 2010? Do I have a bug that …

Member Avatar for BestJewSinceJC
0
106
Member Avatar for monkey_king

I don't know very much C programming but I am pretty good at google. [url]http://www.elook.org/programming/c/strtok.html[/url]

Member Avatar for jephthah
0
3K
Member Avatar for ronpaul53

Some things you can do to help us help you: 1. Use code tags. There is a sticky at the top of the forum that explains how to use Java code tags to put your code in a format that will show up with line numbering next to it and …

Member Avatar for ronpaul53
0
174
Member Avatar for yakovm

In Java you can think of 'this' as being the same thing as the name of the Object. So if you are in the class MyClass, 'this' is your MyClass Object.

Member Avatar for BestJewSinceJC
0
219
Member Avatar for peter_budo

Which is exactly what Masijade seems to be addressing, except he did not go into much detail. At the very least, you'd need your PDF data in a separate class, and a simple "controller" that provided access to the data.

Member Avatar for masijade
0
98
Member Avatar for NewToThis

And also post what error you are getting. If you are successfully reading in the radius, then 2 * radius should give you the diameter without problems as long as the radius is declared as the correct type (i.e. float or double).

Member Avatar for NewToThis
0
102
Member Avatar for kssi89

I don't understand your code, but it shouldn't matter what order the user enters the Dates in. You can still get the difference between them either way. Also: Use classes that already exist. [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html[/url] If you wanted to, you could extend Date and override the compareTo method, making it return …

Member Avatar for JamesCherrill
0
141
Member Avatar for srrjason

Put your code in code tags so that we can see what line numbers those are.

Member Avatar for VernonDozier
0
152
Member Avatar for einhachi

You should not use Frame. Use JFrame. I've never even seen anyone use Frame before, so it's safe to say that it doesn't matter why it isn't working as long as using JFrame works for you. [url]http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html[/url] And I think it's safe to ignore the warning about Serializable unless your …

Member Avatar for painless
0
184
Member Avatar for cebubinary
Member Avatar for cebubinary
0
299
Member Avatar for painless

And inner classes can provide specific functionality for their parent classes. There are relevant examples in the Sun tutorials on inner classes.

Member Avatar for BestJewSinceJC
0
100
Member Avatar for karamjeet2004

Yes. Because you have no main method - you need to put any code (other than variable declarations) inside methods. The main method is the method that runs when you first start your program, *edit* Oops, nevermind - I see that you do have a main method. For statements like …

Member Avatar for karamjeet2004
0
186
Member Avatar for Hockeyfreak889

Try to post things when you figure them out so that other people can see them. Not a big deal, just saying. [CODE=Java]final JOptionPane optionPane = new JOptionPane( "Yes or no?", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);[/CODE]

Member Avatar for BestJewSinceJC
0
73
Member Avatar for Nitz

They are not going to do that. I've seen them refuse to do it before, and rightfully so. Anyway, by posting here or on any other site, you essentially give the site the right to display that work indefinitely. Are you afraid of failing a class or something?

Member Avatar for ~s.o.s~
0
217
Member Avatar for llemes4011
Member Avatar for llemes4011
0
98
Member Avatar for llemes4011

So let me see if I understand. You have five "areas", each of which you want to be connected to the other areas, and you want to be able to adjust the size of each of them? Sun tutorial on JSplitPane, some paragraphs in: "You can divide screen space among …

Member Avatar for llemes4011
0
833
Member Avatar for PhiberOptik

I'm an intern right now for a fairly large company - they gave me a job offer so I'll be working full time next year. I've been talking a lot to people at my company, and learning about a lot of technology currently used in industry, so I'd be glad …

Member Avatar for BestJewSinceJC
0
144
Member Avatar for indianjk

Your explanations at the bottom look like a teacher wrote them. Nice attempt at a disguise. Either way, we don't do projects for people - post your attempt at a solution, then we'll guide you.

Member Avatar for wildgoose
0
101
Member Avatar for JohnPhilipps

Hi John, thanks for using code tags. In the first part of the code tags though, it should say CODE=Java which will put line numbers. If you do that and then tell us which line numbers are relevant (i.e. where you arrive at the end of the copying, and what …

Member Avatar for JohnPhilipps
0
1K
Member Avatar for Acegikmo

The problem is that timeRepaintIn - Calendar.getInstance().getTimeInMillis() is a negative value. Which means that Calendar.getInstance().getTimeInMillis() is greater than timeRepaintIn. So you might want to rethink your logic on deciding how long to sleep for.

Member Avatar for Acegikmo
0
2K
Member Avatar for sam511

[url]http://www.cs.usfca.edu/~wolber/SoftwareDev/C/CStructs.htm[/url] Use a Struct, put both of your linked lists in there. I forget how to make a linked list in C but I think all you need is two pointers, one for each linked list. Beyond that I can't help you, because if your linked list had to have …

Member Avatar for s_sridhar
0
256
Member Avatar for sam511

I'd say your first problem is your inability to use code tags, leading to nobody caring enough to waste their time to read your code.

Member Avatar for kvprajapati
0
91
Member Avatar for VernonDozier

That's a good question, and one I can't answer. Question though: is there any reason you didn't use a CardLayout for the center panel or whichever one was displaying the frames? I think that would make the display easier to manage.

Member Avatar for kvprajapati
0
3K
Member Avatar for MasterGoGo

You'd need to make use of the knowledge that each line is 11 columns long. So every first number you read in goes in the first column and so on. You can use the modulus % operator to figure out which column things go in. If the number of columns …

Member Avatar for JamesCherrill
0
491
Member Avatar for choybutchoy

This depends on how the user is indicating that they are done filling out the JTextField. Are they clicking a button? Is an event fired when the key is pressed? Since you didn't say I'll assume the user is clicking a button once they put their input in the text …

Member Avatar for choybutchoy
0
104

The End.