Page 16 of 21 FirstFirst ... 61112131415161718192021 LastLast
Results 226 to 240 of 307

Thread: Coder's Hang-out

  1. #226
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    I have a question that is two fold about JAVA

    1. I have a GUI with a combobox and a button. I want to be able to do something when one of the options in the combobox is selected and the button is pressed

    2. I need to find a way to be able to connect to the internet, could someone point me to a few nice tutorials? Thanks in advance.

  2. #227
    Join Date
    Oct 2005
    Location
    RP
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    uhm
    1. I have a GUI with a combobox and a button. I want to be able to do something when one of the options in the combobox is selected and the button is pressed
    in vb it would be easy as

    Download Links:
    Links are hidden from guests. Please register to be able to view these links. e.g if the combo had 10 entries 0-9
    if you got index 2 selected and you pressed the button, it will do something


    so in java it would be something like.

    Download Links:
    Links are hidden from guests. Please register to be able to view these links.






    2. I need to find a way to be able to connect to the internet, could someone point me to a few nice tutorials? Thanks in advance
    you mean a browser or stuff like ftp?
    for browser you should load ' shdocvw.dll' forgot the exact name, but it should be similar to it [ie6 or inet]

    for ftping, i believe you need winsock
    Last edited by Leerz25; 21st-March-2007 at 16:37.

  3. #228
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    I have a question regarding Java

    I need to be able to take the text from a textfield and insert it into System.out.println. The reason I ask is because if I can figure that out it shouldn't be too hard to work with what I'm doing

    System.out.print(car_type_textfield);

    This doesn't work because I get this

    javax.swing.JTextField[,77,42,259x28,layout=javax.swing.plaf.basic.BasicT extUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0, border=javax.swing.plaf.BorderUIResource$CompoundB orderUIResource@12d03f9,flags=296,maximumSize=,min imumSize=,preferredSize=java.awt.Dimension[width=259,height=28],caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResourc e[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIRes ource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=0,columnWidth=0,command=,horizontalAlignm ent=LEADING]

  4. #229
    Join Date
    Dec 2004
    Location
    Fantasy Dreamland
    Posts
    1,655
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by Fapbunny View Post
    I have a question regarding Java

    I need to be able to take the text from a textfield and insert it into System.out.println. The reason I ask is because if I can figure that out it shouldn't be too hard to work with what I'm doing
    TextField is a class that is a direct subclass of TextComponent.
    TextComponent has a method of getText() that returns the String
    object with the text that is present in this object, so the correct may be:

    System.out.print(car_type_textfield.getText());


  5. #230
    Join Date
    Sep 2005
    Location
    Mobius
    Posts
    2,171
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Download Links:
    Links are hidden from guests. Please register to be able to view these links. just a simple compilation of code from a C++ tutorial book.
    Guessing game is heavily modified from book.
    Blackjack and Anime Quiz are original code my me and my friends.

    started working with C++ in january at school
    unfortunatly it uses the old Turbo C++ Program from 1995 or something like that so code is very primitive

    edit:
    oh yeah in blackjack..
    0 to stay, and -1 to change ACES from 1 to 11 and viceversa
    Last edited by Tayls; 13th-April-2007 at 15:43.

  6. #231
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Quote Originally Posted by MegaVolt View Post
    TextField is a class that is a direct subclass of TextComponent.
    TextComponent has a method of getText() that returns the String
    object with the text that is present in this object, so the correct may be:

    System.out.print(car_type_textfield.getText());
    lol, thank you for your help, but I figured it out

  7. #232
    Join Date
    Jul 2007
    Location
    Pen Island
    Posts
    1,061
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by maca View Post
    I decided to start making my first game tonight, with the old turbo c graphics library. I was thinking snake but i thought pong might be a bit easier.

    I've got the first paddle working so far, without out it flying off the screen, lol

    Download Links:
    Links are hidden from guests. Please register to be able to view these links. Edit; whoops, the attached exe isn't working, I must have attached the wrong one.

    edit 2, actually, i needed to put the graphics drivers in the zip to make this program run on other pcs
    Bang on Job mate! (DAMN ME! ive got to stop doing that x.x)

    i wanna see Space Invaders next!

    you can do it!

    if you cant, ill try x.x

    well, if anyone has a link to a half decent C++ compiler (borland, or somthing similar plz?)

  8. #233
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Question, I have a problem.

    I wish to be able to have "something" happen when a input is inputed using case. what I mean is that using the switch statement I wish to have an option for each letter

    e.g.

    case 'a':
    printf("you have pressed a");

    The only problem is that using the methods I have I've not been able to do it so that when I press a letter it will do that (I know I have worded this horribly), I've probably just made a mistake somewhere that I cannot see, help is appreciated.

    BTW I'm using C

  9. #234
    Join Date
    Jan 2007
    Posts
    1,156
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If you are switching the right variable and have a break after your printf, it should work.

    char c;

    c = getchar();
    switch(c)
    {
    case 'a': printf(" You have pressed a ");
    break;


    etc....

  10. #235
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Hi again, thanks that worked great, I was just wondering if there was anyway of applying that from the moment you pressed the key as opposed to wainting to press the enter key?

  11. #236
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by TheotheImpaler View Post
    Hi again, thanks that worked great, I was just wondering if there was anyway of applying that from the moment you pressed the key as opposed to wainting to press the enter key?
    You mean asynchronous input, as in, say, Java with KeyListener and whatnot?

    No. C/C++ doesn't include such functionality. You'll need to use a higher-level API for that.

  12. #237
    Join Date
    Jan 2007
    Posts
    1,156
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You can by using getch instead of getchar. getch is defined in conio.h which isn't standard C so your compiler doesn't have to support it.

  13. #238
    Join Date
    Jan 2007
    Location
    Fort Collins, Colorado, United States
    Posts
    2,046
    Thanks
    0
    Thanked 9 Times in 4 Posts
    EP Points
    10

    Default

    I have been recently wondering why hacks for games are primarily in C++ as compared to say... Java. I ask mostly because my brother is interested in hacking and such but he has minimal programming experience. I have some experience in Java (I took a 1 year high school course), but not enough to code hacks so im wondering if Java is capable or practical for creating hacks (or bots) for different games. Some of what he plays are things like Counter-Strike, Ragnarok, Maple Story, that sort of thing.

    I understand that hacks are not simple, I'm just looking for information.

  14. #239
    Join Date
    Sep 2005
    Location
    On the edge of the desert
    Posts
    2,677
    Thanks
    1
    Thanked 32 Times in 21 Posts

    Default

    Java might be capable of that (with the right extensions and such), but it certainly isn't suited to the low-level work required for hacks and similar.

    C/C++ is basically the only language still useful for that kind of thing, and it's a pain in the arse even then.

  15. #240
    Join Date
    Jan 2007
    Location
    Fort Collins, Colorado, United States
    Posts
    2,046
    Thanks
    0
    Thanked 9 Times in 4 Posts
    EP Points
    10

    Default

    I am wondering if anybody knows Olly Debugger at all. My brother made a crappy little console program with C++ and I am trying to find the password. This is how im TRYING to do it, i dont know if im doing it right by any means but:

    I am trying to figure out at what point it checks the password i typed with the correct one. But i cannot figure out at what point it does that, if anybody could help me figure out how to used this program better, i would appreciate it

Similar Threads

  1. Visit The Hang Out!
    By Georgyw5k in forum Free 4 All
    Replies: 5
    Last Post: 28th-November-2003, 05:18
  2. Do You Hang Up On Advertisement Callers?
    By ((KvN)) in forum Free 4 All
    Replies: 52
    Last Post: 21st-July-2003, 11:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About Us

We are the oldest retro gaming forum on the internet. The goal of our community is the complete preservation of all retro video games. Started in 2001 as EmuParadise Forums, our community has grown over the past 18 years into one of the biggest gaming platforms on the internet.

Social