Never mind, I figured it out. In your constructor, post the following code, and replace "buttonName" with the name of a JButton:
[CODE]getRootPane().setDefaultButton(buttonName);[/CODE]

arithehun -1 Light Poster

Okay, you know when on like an alert window, or a form, one of the buttons automatically gets executed when you press enter, such as shown. [I]See Picture #1[/I]

[i]So I was wondering[/i] how I could do this in Java for a both a JFrame and a JOptionPane. Thanks.

arithehun

[B]Picture #1[/B]

Just use the JPanel to paint. Use the JFrame for interface. Don't cram it all into a JFrame just because you can only extend that class. Extend the JFrame, but create a JPanel and paint on it.

The Android policies rule. The UI rules. The SDK Eclipse plug-in sucks ba__s.

Thanks to you all. No one specifically gave me the concluding answer, but combined, these all solve my problem.

[B]THREAD SOLVED[/B]

This application is obviously developed with the native iOS SDK, as you probably know.

To develop an application like that in Flash, well, just develop it. Then use the included packager for iPhone to turn it into an application. Learn how here: [URL="http://labs.adobe.com/technologies/packagerforiphone/"]Adobe CS5's Packager for iPhone[/URL] .

[B]However, I would not recommend doing this for a number of reasons.[/B]

  1. Flash-- Steve Jobs finally reformed, and let the packager fly, but that may be subject to change. Besides, consider the reasons that Jobs may have dropped Flash in its true form in the first place.
  2. Apple-- The iPhone SDK is made FOR the iPhone. That means that it's controls are the ones you know and love on the iPhone. Objective-C 3.0 has been revamped to add a large array of convenient, and incredible, classes that act as UI controls. Objective-C is like a cheetah compared to a snail in in a race, with the cheetah and the snail Objective-C and Flash respectively. The SDK is cheap; free, that is. The learning curve it not too steep, taking that from a freshman, just use books or sources such as Lynda.com, don't even try to un-muddle Apple's unstructured documentation.

[B]Another reason[/B]

Your question makes us scratch our heads and wonder whether you know anything about Flash. So why pick up one platform, when the other is so much more superior?

Anyway, good luck entering the iPhone world (a.k.a. the wild West).

Why can't you do this? An error? If so, please post it!

Btw, if you could post your files on a site, it would be extremely helpful.

Thank you all for all the extremely helpful replies. One of the reasons I was so vague was because I didn't know all the answers, but now that you pointed them out I will answer all that I can.

  1. As I said, the programmer is now a college freshman, and the team leaders know as much programming as I know about Tim-Bukh-Tu. Therefore, they did not know or care what had been used before.

  2. The kit I have been using is called WPILib. It is extremely easy, and open-source, but is it a good, powerful library? It was written for both C++ and Java, but older versions can be found for straight-out C, but I definitely cannot go back to classless programming.

  3. I'm sorry, I feel really stupid. [B]SDK[/B] was totally the wrong word. I meant [B]library[/B]. They ca be easy to confuse. In case even "library" is wrong, even though I doubt that, the kit is just a bunch of classes written for the robot.

I'm sorry that's all I can answer right now. Mike, you were extremely helpful, and try all the software as well as contact FIRST.

Thank you all for all the help!

Bump.

arithehun -1 Light Poster

I have joined our local high school's FIRST robotics club, but their programmer graduated last year, so who got selected? The wimpy freshman: me! I am an intermediate programmer (PLEASE don't look at my previous posts, I now know two languages, and am better). So I downloaded an instruction booklet. However, the leader wanted me to learn the SDK in C++ (I am way more comfortable with Java) because it is so much faster.

[b]So, the problem is[/b], I have to learn this super-class by the time we get the robot, not during that time. However, I learn by experimenting, which is impossible without a simulator. Besides, I only really know Objective-C and Java. So my point is, it would be extremely helpful if there was a compiler emulator. Nothing to complex, just something to give me a visual of what the code does. This would be extremely helpful.

Thanks.

arithehun -1 Light Poster

Anyone that develops GUI applications in C++ will definitely be familiar with the C++ class.

However, I am wondering who wrote this vast class?

[b][U]Return-Type Methods or functions[/U][/b]
Okay, so think of functions as an ATM. You input a bunch of values, and they output one. The same is with a method or function. It must "spit-out" a number that fits its return type. It is usually used for variables.

[CODE]public double multiply(int firstVar, int SecondVar){
int product=firstVar*secondVar;
return product;
}
[/CODE]

All the variables from firstVar to product were local variables specifically owned by the method or function. However, when you return a value, it becomes global to the entire class.

[b][U]Void methods or functions[/U][/b]
A type variable has to return a value, hence your
[CODE]return 0;[/CODE]
However, when a method is [B]void[/B] it cannot return a value. There for, the multiply method would have to be like this:
[CODE]
int product;

public void multiply(int firstVar, int SecondVar){
product=firstVar*secondVar;
}
[/CODE]

See the difference? To return a value, you had to manipulate a global variable instead. Your method obviously did not need to return a value; what good does returning "0" do? (If you need true or false, make it a boolean method, and have it return true or false, not "true" or "false" [those are strings]). Therefore, you would waste precious (not really) memory by allocating it; void methods take up less memory (RAM).

[B]Please mark this as solved if I did[/B]

I'll try it out on the weekend.

I believe this thread is resolved, then. Please mark it as solved at the end of a thread.

arithehun -1 Light Poster

I want a forum for a website, and I like this system best. Is this forum open source? If so, where can I download it?

(a) 1/3
(b)0 (one is almost done)
(c)$0.00
(d)There is a very good amount of support on the subject. It's just that the iPhone programming guide is more of a resource; it can't be followed as a guide.

And as for your first statement, they could also just give away the password. The point is if you don't want to set-up a php page and shell, you could do this instead. It has almost the same functions unless you create a database.

I do know how!

[code=c]
while(true){
contents;
if(whatever){
whatever;
}
else{
break;
}
}
[/code]
Or

[code=c]
int i=0;
for(i=0;i<50;i++){
whatever;
}
[/code]

But thanks for trying to help anyway.
:p

Why is everyone marking my posts down?

Thanks! But can you explain how this works, what i should do? Thanks!

And so are you! Bringing it back alive!

Wait! This site is down. Too bad...

Get Computer Science Lab. It's a good introduction!

jonsca commented: Don't bump old threads -1

You should check out DreamInCode.net for more help! I hope this reply came fast enough!

arithehun -1 Light Poster

I have a question: Is there any tutorial or way I could create a batch file that scans the folder that it's in, and then prompts you with an option of whether to delete any (C++, for example) files that don't begin with a command line, e.i. doesn't start with "//Start command line". Any ideas?

[QUOTE=Aranarth;1233735]And what keeps you from going to the site directly?[/QUOTE]
Because, you name the file something like "secret.ghjghydfghdhd.secret.fjfgdfsgsfdgsfdgsfgds.password.ddjhdgshdgsh.secret.html"

Yeah, I'm too lazy to use a loop.

arithehun -1 Light Poster

This is a tutorial, not a program.

[b]Step 1[/B] First, create a file for your website, and name it "admin.html".
[b]Step 2[/b] Now on it, say, "You must log in to view admin, blah,blah,blah. Click here to launch our client."
[b]Step 3[/b] Link "Click here" with the C++ .exe file we will create later.
[b]Step 4[/b] Now, create a new file with a bunch of random letters, then ".html". Make the file name AT LEAST 100 characters long. All your admin stuff will go here.
[b]Step 5[/b] Now Start a C++ program, and type the following:
[code=c]

include
include

using namespace std;

int main(void){
start:
cout << "Welcome to EnergeticLeadershipParenting admin login" << endl;
cout << "Login using your administrator password:" << endl;
string login;
getline (cin, login);
if (login == "yourPassword"){
ShellExecute(NULL, "open", "http://www.yourdomain.com/hundredCharacterFile.html",
NULL, NULL, SW_SHOWNORMAL);
return 0;
}
else { cout << "Login failed" << endl; goto start;}

cin.get();
return 0;

}
[/code]

That's it! Sorry it is so brief, I have a lot of homework to do.

Any questions?

~arithehun

Actually, I posted this in a Dark GDK forum too, and I have now replied! I have noticed there were many views, so a lot of people want to know, but do not know how.

Now you can!
Go here to see my other post answered:
[URL="http://forum.thegamecreators.com/?m=forum_view&t=169347&b=22"]Dark GDK Forum: Question Solved[/URL]

arithehun -1 Light Poster

Hello, I have a somewhat basic question about Dark GDK. I am taking Dark Basic courses, and converting the code to Dark GDK (not a difficult task), because I am unwilling to spend $60 on an inferior compiler.

I am taking a complete FPS tutorial. It went fine for a while, until I had to convert an integer to a string. The code, with my knowledge, I knew would not be accepted in Dark GDK. However, I could not figure out the equivalent in Dark GDK. I know you can do it in C++, but I have never been able to get C++ and Dark GDK to work well together. I have already asked the Dark GDK forum, but I have had no replies.

Here is the code in Dark Basic
[CODE]IF OBJECT EXIST(2)=1

CENTER TEXT OBJECT SCREEN X(2),OBJECT SCREEN Y(2)-70,"Enemy Health: "+str$(EnemyHP#)

ENDIF[/CODE]

Here is the complete code a little farther along in Dark Basic:
[CODE]`Created by

`Date Started:

SYNC ON:SYNC RATE 0:HIDE MOUSE

MAKE OBJECT SPHERE 1,50:COLOR OBJECT 1,RGB(000,255,000)

MAKE OBJECT SPHERE 2,50:COLOR OBJECT 2,RGB(255,000,000):POSITION OBJECT 2,130,0,0

MAKE OBJECT BOX 3 ,100,100,5:POSITION OBJECT 3,0,0,150

MAKE OBJECT SPHERE 9999,30

MAKE MESH FROM OBJECT 1,9999

DELETE OBJECT 9999

ADD LIMB 1,1,1

OFFSET LIMB 1,1,0,0,500

DELETE MESH 1

POSITION CAMERA 0,500,-500:POINT CAMERA 0,0,0

EnemyHP#=5000

Ammo#=1000

MaxAmmo#=1000

DO

IF UPKEY()=1 THEN MOVE OBJECT 1,.5

IF DOWNKEY()=1 THEN MOVE OBJECT 1,-.5

IF LEFTKEY()=1 THEN TURN OBJECT LEFT 1,.7

IF RIGHTKEY()=1 THEN TURN OBJECT RIGHT 1,.7

IF MOUSECLICK()=1

IF Ammo#>0 ...