Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Plz Help me translate this JFrame to Python

Posted on 2014-01-12
4
Medium Priority
?
487 Views
Last Modified: 2014-01-21
Hi, I Am a Python NEWBIE

Does anyone have time to plz show me what this kind of Java JFrame + capability looks like in Python?

This will all be for intended use in a game. Is PyGame more suited to this? Why or why not?
What can PyGame do in this situation?

Thanks

class gameWindow extends JFrame implements MouseListener, KeyListener {

  public gameWindow(ClientNetworkEngine CNE, int x, int y) {
            localCNE = CNE;
            setSize...
            setTitle("Game Window");
            ExternalGameLoopThread eglt = new ExternalGameLoopThread(this);
            setLocation(x,y);
            setVisible(true);
            addMouseListener(this);
            addKeyListener(this);
            eglt.start();
            
  }
       public mousePressed(MouseEvent m) {
           System.out.println("mouse pressed at : "+m.getX()+" , "+m.getY());
       }
       public  keyPressed(KeyEvent k ) {
           System.out.println("key pressed : "+k.getChar());
       }

}

Open in new window

0
Comment
Question by:beavoid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 total points
ID: 39778288
Python is just a language. To do anything like a JFrame (ie. a GUI) you would have to select which framework/toolkit to use with Python to achieve this, as there are a number of them. See here... https://wiki.python.org/moin/GuiProgramming    You'll notice that PyGame is one of them, is that the one that you want to use?
0
 

Author Comment

by:beavoid
ID: 39778398
I think PyGame looks perfect for my needs.
Do you think it will be decent speed / frame-rate for a fully functioning network RTS?
ie a Blizzard quality RTS. Full screen is a big plus. Will graphics at full screen be clunky?

This means I wont have to be mired in Direct X? Which compared to pygame looks tough.

Thanks
0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
The viewer will learn how to count occurrences of each item in an array.
Simple Linear Regression
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question