Doogledude123 45 Posting Whiz

Would you be able to copy and paste the code so I can run a test on it?

Doogledude123 45 Posting Whiz

I would recommend getting an Application called Eclipse. It is a Java IDE for developers and really helps with fixing code errors, it also points out errors before you even run the program.

Doogledude123 45 Posting Whiz

You should be using some sort of IDE to help you with this. I see your code, but I still do not understand what you are looking for. Are you getting an error when attempting to run your code? Or are you looking for clarification of something?

Doogledude123 45 Posting Whiz

I really don't understand what you are asking? Are you asking for help in doing that assignment? Or are you wondering how each classes are linked together?

If this is a Homework question, please review the Daniweb Community Rules in which you did agree to when you signed up. A link can be found here.

Do provide evidence of having done some work yourself if posting questions from school or work assignments

Doogledude123 45 Posting Whiz

Eclipse works fine :P I have since switched to IntelliJ IDEA community edition. It doesn't matter what you use for it. Update your JDK to Java 8, JavaFX is built in now.

Stick with the SceneBuilder for a while, then program your own GUI through code.

Doogledude123 45 Posting Whiz

Hey Slavi, glad to see some interest in Java FX. I definitely think Java FX is excelling now and will soon become a primary over swing.

If you're looking into getting into it, I would suggest building a simple GUI Program (Anything you want), inside of the SceneBuilder (What JC was talking about), and adding a Controller Class to the GUI to do program the logic. You can grab SceneBuilder from the JDK 8 Extra Downloads page.

Use an FXMLLoader to load your GUI.
FXMLLoader loader = new FXMLLoader(MainClass.class.getResource("path/to/fxml/gui.fxml"));

For programming the controller, don't forget to set the fx:id under the code menu on the right side in SceneBuilder, and then go ahead and grab the Sample Controller Skeleton from View > Show Sample Controller Skeleton. Make sure full is checked then just copy-paste that into an empty class file.

Link your new Controller by calling it in loader.setController(new GUIControllerClass());

Of course this isn't all you need, google around for diferent things, like a basic tutorial, this should be a good start however. Come back if you have questions.

JamesCherrill commented: Excellent input. Thansk you. +15
Doogledude123 45 Posting Whiz

A general rule I follow by, is that the only thing needed in main is a call to create a new instance of the class. That way I can keep the class not static and everything else that way too, unless needed.

JamesCherrill commented: A good "general rule". +15
Doogledude123 45 Posting Whiz

Yes, and yes!

Doogledude123 45 Posting Whiz

length() is actually a method inside of all Arrays. It returns how many values are stored inside of the Array.

The for loop is necessary in that example, however because it is an Array, you could simply use args[1] or some other number. It highly depends what you need it for.

Doogledude123 45 Posting Whiz

As jwenting said, these are missing imports. I have a feeling that you're a begginer and you're going through some tutorials just copying code.

If you have done anything previous to this by using the above method, awesome! I would suggest going back a few steps and redoing what you need to do without looking at completed code.

Also, here are some recommended projects for beginners from the "Java Projects for Learners" thread.

Keeping in mind with the aspect of "for learners", Here are some projects I started out with.

THESE ARE ALL TEXT BASED(NO GUI)

Area Calculator
Calculate the area given the shape and dimensions needed, then output.

Blackjack
Make a Blackjack game that asks the user if he wants to hit. Check for
bust if total exceeds 21.

Calculator
Simple addition, subtraction, division, and multiplication calculator.

Ceasar Cipher
Encrypt a String given a shift value.
See This.

Fibonnaci Sequence
Calculate the fibonnaci sequence up to a given number of times.

Grading Program
Output a mark(A, B, C, D, or F) given a number 0-100.
F = 0 - 59
D = 60 - 69
C = 70 - 79
B = 80 - 89
A = 90 - 100
EXTRA: Change A to 90 - 99 and give A++ for 100.

Guess My Number
Have the computer generate a number that the user has to guess correctly,
if the user guesses …

Doogledude123 45 Posting Whiz

Dont forget to mark the thread as solved!

Doogledude123 45 Posting Whiz

No one will help you do your homework. The whole reason for projects is you test your knowledge, not some one elses.

When you signed up you also agreed to the following "Do provide evidence of having done some work yourself if posting questions from school or work assignments."
http://www.daniweb.com/community/rules

If you need help with something your stuck on, post it on a thread and provide some of your code where there is problems, then someone will help you.

Doogledude123 45 Posting Whiz

Please mark as Solved.
Glad your issue was fixed.

Doogledude123 45 Posting Whiz

Oh well, that may help in some way. Good luck with it!

Doogledude123 45 Posting Whiz

You enter a number from 0 - 9 per character. There also is Encrypt and Decrypt methods that each can be called from arguments. And the text is there as well.
I do not see what the problem is. The result gives the same number of characters encrypted as it is decrypted.

I dont see how you couldnt read the code to figure out how "the number provided" "should logically" never be that high. Its quite easy to figure out that Im parsing each number individually.

encrypt 32847 hallo = ;3D@F
decrypt 32847 ;3D@F = hallo

Doogledude123 45 Posting Whiz

I just finished a ceasar cipher not too long ago. I'll give you my code for reference.

package com.github.geodox.ceasarcipher;

public class CeasarCipher
{
    private static StringBuilder sb = new StringBuilder();

    public static void main(String[] args)
    {
        String key = args[1];
        String text;

        for(int i = 2; i < args.length; i++)
        {
            sb.append(args[i]);
            sb.append(" ");
        }
        sb.deleteCharAt(sb.length()-1);
        text = sb.toString();

        if(args.length < 3)
        {
            System.out.println("Not Enough Arguments");
            System.out.println("Example Expected Arguments: encrypt, decrypt 795043 google");
        }
        if(args.length == 3)
        {
            if(args[0].equals("encrypt"))
            {
                System.out.println("Uncrypted Text: " + text);
                System.out.println("Key: " + key);
                String EncryptedText = Encrypt(key, text);
                System.out.println("Crypted Text: " + EncryptedText);
            }
            else if(args[0].equals("decrypt"))
            {
                System.out.println("Encrypted Text: " + text);
                System.out.println("Key: " + key);
                String DecryptedText = Decrypt(key, text);
                System.out.println("Decrypted Text: " + DecryptedText);
            }
            else
                System.out.println("Invalid Argument; 'encrypt' or 'decrypt' Expected.");
        }
        if(args.length > 3)
            System.out.println("Too Many Arguments");
    }

    private static String Encrypt(String key, String text)
    {
        char[] cryptedText = new char[text.length()];
        char[] textArray = new char[text.length()];
        int[] keyArray = new int[key.length()];

        for(int i = 0; i < text.length(); i++)
        {
            textArray[i] = text.charAt(i);
        }

        for(int i = 0; i < key.length(); i++)
        {
            keyArray[i] = key.charAt(i);

            char c = textArray[i];
            int s = keyArray[i];
            if (c >= 32 && c <= 127)
            {
                int x = c - 32;
                x = (x + s) % 96;
                if (x < 0) 
                    x += 96;
                cryptedText[i] = (char) (x + 32);
            }
        }

        return new String(cryptedText);
    }

    private static String Decrypt(String key, String text)
    {
        char[] decryptedText = new char[text.length()];
        char[] …
Doogledude123 45 Posting Whiz

I believe what he is saying is when he presses the . key on his calculator multiple times, it adds more then one .

As tinstaafl says, please post code on what you have done to attempt to accomplish this.

Doogledude123 45 Posting Whiz

@tinstaafl Im assuming he wants to keep Minimize and Maximize, thats what my code does.

Doogledude123 45 Posting Whiz
Private Const CP_NOCLOSE_BUTTON As Integer = &H200
    Protected Overrides ReadOnly Property CreateParams() As CreateParams
        Get
            Dim myCp As CreateParams = MyBase.CreateParams
            myCp.ClassStyle = myCp.ClassStyle Or CP_NOCLOSE_BUTTON
            Return myCp
        End Get
    End Property

That should work, put into the Form's code you wish to disable under:

Public Class Form

Credit goes to @Fame95 His answer was correct.

Doogledude123 45 Posting Whiz

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724353(v=vs.85).aspx

Try reading over that, see if it helps

Doogledude123 45 Posting Whiz

Should be the same, did you try it yet?

Doogledude123 45 Posting Whiz

Yeah, censorship sucks. Stupid japanese government. :)

Doogledude123 45 Posting Whiz

I really need to get caught up on Anime, and Manga. I used to spend 100's of $ on Manga (per month)! Was really awesome and I need to start watching again.

I guess with To Love Ru out, theres no better time but the [present]!

Doogledude123 45 Posting Whiz

I dont believe there is anyway of doing this, after multiple google searches, nothing. So unless someone comes out and says for sure. Im gunna be saying no.

Doogledude123 45 Posting Whiz

Some code for the Alarm, and how you set up the timer would be nice.

Cant debug without code.

Doogledude123 45 Posting Whiz

Just add a new button and stick in this?

Cls
Form1.DrawWidth = 30
For i = 1 To 5
Line (150, 200)-(150, 100), vbMagenta: Delay: Cls
Line (150, 300)-(150, 200), vbCyan: Delay: Cls
Line (300, 300)-(150, 300), vbBlack: Delay: Cls
Line (450, 300)-(300, 300), vbBlue: Delay: Cls
Line (450, 200)-(450, 300), vbWhite: Delay: Cls
Line (450, 100)-(450, 200), vbRed: Delay: Cls
Line (300, 100)-(450, 100), vbGreen: Delay: Cls
Line (150, 100)-(300, 100), vbYellow: Delay: Cls
Next

All I did was reverse the order. Try It, not garunteeing that it will work.