Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
~46.3K People Reached
Favorite Forums
Favorite Tags

52 Posted Topics

Member Avatar for JamesCherrill

I'm interested to see what this looks like - could you post a screenshot of your application running? I'm using Ubuntu at the moment and can't get it working. Will try it later on Windows 7 when I get a chance.

Member Avatar for Reverend Jim
2
1K
Member Avatar for Sunshineserene
Member Avatar for leiger

This code works perfectly fine when I run it as a class file (the font is located in the same directory) - however when I package it into a JAR file it can't find the font and the program crashes. The font is definitely being included in the JAR archive, …

Member Avatar for karlmeier
0
4K
Member Avatar for nickmi

Check which button the user clicked on, then create your new JFrame and call [ICODE].setVisible(true)[/ICODE] on it.

Member Avatar for mKorbel
0
153
Member Avatar for G_S

I agree completely with James. Without seeing the code itself, it sounds okay so far. Building on his post: Anything that might change in the future (like the file name) could be given a default value in the class. Then provide two separate constructors, one of them allowing you to …

Member Avatar for ~s.o.s~
0
212
Member Avatar for Feriscool

Taywin, the syntax the OP used is also valid. It's a for-each loop. Examples: [CODE] // String[] names for (String name : names) { ... } // int[][] ARRAY for (int[] data : ARRAY) { ... } [/CODE] However I think this is the place where the Exception may be …

Member Avatar for JamesCherrill
0
152
Member Avatar for janice91

[QUOTE]I am new to the LinkedList concept[/QUOTE] I would strongly suggest reading Wikipedia for a good explanation of Linked Lists as well. It may help you to grasp the concept a bit better: [URL="http://en.wikipedia.org/wiki/Linked_list"]http://en.wikipedia.org/wiki/Linked_list[/URL]

Member Avatar for Taywin
-1
187
Member Avatar for manjushreekaran

Which XML library are you using, which DBMS are you using, and what code have you written so far? Help us to help you :)

Member Avatar for leiger
0
106
Member Avatar for archie.herbias

Try BorderLayout. I'll try to give you a step-by-step walkthrough: [LIST=1] [*]Create a JFrame - [ICODE]public class MyFrame extends JFrame { ... }[/ICODE] [*]Get the content pane - [ICODE]JPanel contentPane = (JPanel) this.getContentPane()[/ICODE] [*]Set layout manager to BorderLayout - [ICODE]contentPane.setLayout(new BorderLayout())[/ICODE] [*]Add a text area in the centre of the …

Member Avatar for leiger
0
226
Member Avatar for gayathriselvam

What you have used above will work, but you need to point to an existing Java source file. Try putting it on your Desktop and trying something like this: [CODE]C:\Program Files\Java\jdk1.7.0\bin>javac C:\Users\MyName\Desktop\HelloWorldApp.java[/CODE] Adding the JDK to your system path is a more long-term solution, which would allow you to call …

Member Avatar for leiger
0
195
Member Avatar for mitchiexlolz
Member Avatar for leiger
0
123
Member Avatar for Proda

[QUOTE]- this part I am not sure how to write at all - Implement a Java class (PrimeProgression) that extends the Progression class so that each value in the progression is the smallest prime number that is greater than the previous one. The default constructor PrimeProgression() use 2 as the …

Member Avatar for leiger
0
235
Member Avatar for spittaxjets

I would suggest asking your teacher or lecturer what they are looking for, as they will end up marking your "Assignment 1". The main method can be placed anywhere within the class definition for VendingMachine: [CODE] public class VendingMachine extends java.lang.Object { // Main method somewhere in here } [/CODE] …

Member Avatar for leiger
0
143
Member Avatar for leiger

Hey everyone, Usually when I create a Java application I will use the built-in Preferences class to save user preferences. I believe this saves user information to the registry on Windows, and to other locations on Linux / Mac OS X. When I need to store a serialised object, I'm …

Member Avatar for leiger
0
187
Member Avatar for Buffalo101

You need to set the Look & Feel [I]before[/I] you create any frames! It seems that you are only doing this after having created the first one? Try setting the L&F in your main method, before you create the first frame (put the main method in a different class, not …

Member Avatar for leiger
1
158
Member Avatar for printmatic

[CODE] public int nextDay() { int next; next = day + 1; return next; } [/CODE] What if the day is Saturday (number = 6) ? Then you'll just increase it to 7, but what you really want is to reset the number to 0. Same happens in reverse (previous …

Member Avatar for apines
0
749
Member Avatar for luoyi2008061424
Member Avatar for leiger
0
194
Member Avatar for koushikG

Are you allowed to use a JButton? The simplest way to do this would be to add a JButton that covers the whole frame, and resize the frame however you want when the button is clicked. Otherwise, you'll have to set up a mouse listener on the frame.

Member Avatar for hanvyj
-2
144
Member Avatar for wobuaini

Does this help? [CODE] public static void printABs(int n) { // Loop: start at i=1 and go to i=n // Create a queue, and add "A" and "B" // For every character X in the queue, Print out strings that are i characters long, starting with X } [/CODE] Just …

Member Avatar for leiger
0
99
Member Avatar for MeandJava

Just put the whole thing in a while loop. [CODE] while (true) { // Program here // Ask user if they want to continue // If yes, do nothing. If no, "break" out of while loop. } // Any code you want to execute before the program ends goes here …

Member Avatar for leiger
0
7K
Member Avatar for Guna16
Member Avatar for waldchr

Pretty sure this isn't possible. An OS would generally prevent you from messing around with other applications for security reasons.

Member Avatar for leiger
0
75
Member Avatar for RBK_RBK
Member Avatar for koushikG

Firstly, create the frame and set size/location and any other properties. Then make it visible as masijade posted above. You would set the first frame as parent of the second frame. Make this code execute in an action listener. For example, when someone clicks a button the second form could …

Member Avatar for javanub123
0
98
Member Avatar for thr

I had problems with XML-RPC in Java a few months back, but eventually got it working. It looks like you're heading in the right direction. You seem to be using the correct libraries. Do you know why the connection is being refused? Is it possible that you need to authenticate …

Member Avatar for leiger
1
628
Member Avatar for yup790

I'm a stickler for spelling and grammar ;-) You may want to change "[I]How many possablilities[/I]" to be "[I]How many possibilities[/I]" (you've misspelt it!)

Member Avatar for leiger
0
177
Member Avatar for Dokka
Member Avatar for tong1
0
270
Member Avatar for leiger

I have imported the Apache XML-RPC jar files, and got them working (has taken me all day to figure out how to get it working - so I'm kind of frustrated at the moment ;D) ... but that used the execute(..) method which requires two parameters ... there was no …

Member Avatar for leiger
0
2K
Member Avatar for leiger

I am attempting to access an XML-RPC API method using a Java client. I'm fairly certain that the server is written in Python. The API is part of the wiki farm Wikidot.com API info: [url]http://www.wikidot.com/doc:api[/url] API method info: [url]http://www.wikidot.com/doc:api-methods[/url] Does anyone here know what the equivalent of this statement is …

Member Avatar for leiger
0
547
Member Avatar for efelinks
Member Avatar for yapaarachchi

Which operating system are you using? It's different depending on whether you're using Linux, Mac OS X or Windows.

Member Avatar for leiger
0
119
Member Avatar for gailross

I strongly suggest that you use an IDE instead of just a text editor and console to compile - it will help you to debug your own programs :) I added your code to a new project in Eclipse and it claimed that the error was on this line: [CODE]public …

Member Avatar for leiger
0
156
Member Avatar for leiger

I've created a Java application and converted it into JAR format to redistribute. It works fine on Windows 7, Windows XP, SunOS and Mac OS X 10.5 ... but whenever I try to run it on Ubuntu 10.04 I run into a few problems: [LIST] [*]When running the application it …

Member Avatar for leiger
0
178
Member Avatar for AbhikGhosh

What are you trying to print from? The JTextComponent has a print method, for example. You could use that..? [url]http://java.sun.com/javase/6/docs/api/javax/swing/text/JTextComponent.html[/url]

Member Avatar for AbhikGhosh
0
320
Member Avatar for KcNaveen

What do you want to do? - Use the toString() method of an existing class - Write your own toString() method for a class of your own ?

Member Avatar for leiger
0
90
Member Avatar for mrblaze

If "B tree" means "binary tree", then I can probably help you with that as I've used them recently. Same goes for AVL trees. What code have you written so far?

Member Avatar for leiger
0
103
Member Avatar for adams161

This is a wild guess - but could an Undo/Redo-style feature be used for back/forward navigation? Other than that I have no suggestions and have no idea if there is any more ideal solution available (still a newbie and still learning!) :)

Member Avatar for leiger
0
108
Member Avatar for leiger

I'm trying to list a bunch of buttons vertically, but am having problems even getting that much done. I'm pretty sure I have the scroll pane working (it just isn't being used yet so I can't test it). This is part of an assignment so I'd prefer not to post …

Member Avatar for leiger
0
2K
Member Avatar for leiger

This is code I've taken from another website, and adapted to work with the JFileChooser. I got it working so that someone could select a java file with the chooser, and I'd send a "java -jar FILENAME" to the console and the app would launch. However as soon as I …

Member Avatar for Gribouillis
0
647
Member Avatar for leiger

Python works fine in the console, but I'm having problems using python in a Java program. In case someone here has any ideas, I'm posting a link back to my original post (please reply there and not here): [url]http://www.daniweb.com/forums/post1246152.html#post1246152[/url] Thanks!

Member Avatar for leiger
0
153
Member Avatar for pi_lord12

You have typed this: [code=java] userInput=JOptionPane.showInputDialog(null, i, "Game", JOptionPane.INFORMATION_MESSAGE, sword, null, null); [/code] According to the API doc, this is the method signature for [I]showInputDialog[/I] that you are using: [code=java] public static Object showInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue) throws HeadlessException [/code] …

Member Avatar for pi_lord12
0
175
Member Avatar for SoggyFries

It seems strange to me that you're trying to find the smallest value on an unsorted tree. If this is an assignment, does it say that you're not allowed to sort the tree? If you can rebuild the tree in the correct order, then you just loop continuously looking at …

Member Avatar for leiger
0
181
Member Avatar for adity

Can you post the code you're using at the moment...? Otherwise I have no idea what to suggest.

Member Avatar for leiger
0
118
Member Avatar for DrApe1

Just a quick reminder... but if you were planning to "add" two chars together to make a String, you wouldn't get addition: char '3' and char '7' combined into string is "37" (not "10") Then converting to int, and you'll get an int of 37 instead of the 10 that …

Member Avatar for DrApe1
0
122
Member Avatar for leiger

Basically I've got a text editor which revolves around a jTextArea. There are some settings (e.g. whether line wrap is enabled) that I'd like to save to a file when the application closes, and then load up again when it runs next. I've spent a few hours trying to get …

Member Avatar for leiger
0
200
Member Avatar for idlackage

I can't figure out what the problem is... and it's been 22 days without a response from anyone else so I assume they can't either. Did you end up solving the problem?

Member Avatar for idlackage
0
241
Member Avatar for jakx12

A circle has an infinite number of "points"... or zero... depending on how you look at it. Not sure exactly what you're trying to do either. Could you add comments, or post the same snippet of code that you're using for a different shape (e.g. rectangle) so that I can …

Member Avatar for leiger
0
124
Member Avatar for spartanace

Not sure how you'd do it using that code, but somehow you need to access the parent class. I just tried, and "parent" doesn't seem to work the same way that "this" works, so there goes what I was going to suggest ;-) The way I would do this though …

Member Avatar for javaAddict
0
3K
Member Avatar for DeadSoul

When you say "its not working properly" ... could you elaborate? What happens and what do you see? Are there any compilation error messages? Or run-time error messages? - leiger

Member Avatar for leiger
0
164
Member Avatar for memo1

As quuba said, your lines 2-4 are redundant. You're passing in values to the method, then completely ignoring them and getting values from the console instead!! You should either remove lines 2-4, or remove the parameters - getInvoiceAmount() - up to you which one you do as the question isn't …

Member Avatar for leiger
0
78

The End.