Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Munchor

Pages: 1 ... 22 23 [24] 25 26 ... 424
346
Computer Programming / Re: [Java] Adding graphics to frame
« on: August 18, 2011, 01:03:36 pm »
Thanks nemo! I have this now:

Runner.java
Code: [Select]
public class Runner
{
    public static void main(String[] args)
    {
        new Game().run();
    }
}

Game.java
Code: [Select]
import java.awt.Graphics2D;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class Game extends JPanel
{
    JFrame mainFrame = new JFrame("Game");

public Game()
{
        mainFrame.setSize(800, 600);
    }
    public void run()
    {
        mainFrame.setVisible(true);
    }
    public void paintComponent(Graphics2D g)
    {
        super.paintComponent(g);
        g.drawLine(5, 5, 10, 10);
    }
}

Right now, my only question is adding the Graphics to the Game Panel. Thanks!

347
Miscellaneous / Re: SirCmpwn vandalizes Axe Parser forum
« on: August 18, 2011, 12:57:35 pm »
I wonder how nobody noticed it, but either way, it's terrible!

348
Computer Programming / Re: [Java] Adding graphics to frame
« on: August 18, 2011, 12:45:32 pm »
Nemo, what if I use Graphics instead of Graphics2D? The example you gave me is good, but the problem is I need my code organized in separate files, I am expecting this to be a rather large project.

Thanks for the quick response too!

349
Computer Programming / [Java] Adding graphics to frame
« on: August 18, 2011, 12:25:15 pm »
I was just trying to add Graphics2D to a Frame this way:

Game.java
Code: [Select]
import java.awt.Component;

public class Game
{
public static void main(String[] args)
{
MainFrame mainFrame = new MainFrame();
MainGraphics mainGraphics = new MainGraphics();
mainFrame.getContentPane().add(mainGraphics);
}
}

That file contains the main function, where I create a new frame and a new graphics (both classes made in separate files), and then I try to add the graphics to the frame.

The problem is, though, I get:

Quote
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
   Cannot instantiate the type MainGraphics
   The method add(Component) in the type Container is not applicable for the arguments (MainGraphics)

I can only add components to frames and content panes.

So I tried to make mainGraphics a component, like this:

Code: [Select]
Component mainGraphics = new MainGraphics();
However, I get (in this line):

Quote
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
   Type mismatch: cannot convert from MainGraphics to Component
   Cannot instantiate the type MainGraphics

Does anybody know how to solve this? Thanks! Also, MainGraphics is an abstract class, here's its code:

Code: [Select]
import java.awt.Graphics2D;


public abstract class MainGraphics extends Graphics2D {
public MainGraphics()
{
this.create();
this.drawLine(5, 5, 10, 10);
}
}

350
News / Re: OmnomIRC moved to new server
« on: August 18, 2011, 04:29:55 am »
I didn't see that coming after Sir returned to being a CoT. I also think it's fair that his account gets delete, what he did was really bad.

Regarding what happened to the IRC channel, I don't really know because I was not there, but I don't mind the move to OmniNET, I actually think it's much better than EFNet for the bots and such.

351
TI-Nspire / Re: Hyena: a simple (Lua) GUI library for the TI-Nspire
« on: August 17, 2011, 08:22:28 am »
Looking great hoffa! I'd love some project like this, I have no idea of how you managed to make it too.

352
Math and Science / Re: Math mind read
« on: August 17, 2011, 07:09:32 am »
I had Denmark and Koala. So Denmark and Kangaroo, that was close.

353
TI Z80 / Re: Math++
« on: August 17, 2011, 07:07:13 am »
What calculator is this for?

http://www.ticalc.org/archives/files/fileinfo/432/43266.html

I have made something with formulas, and it's open-source so you can check it out ;)

354
TI-Nspire / Re: LunaGUI - A Linux GUI Tool to use Luna
« on: August 16, 2011, 03:52:54 pm »
Is that the source attached or is it an executable?

It's *just* the source :)

355
You can still play the games on an emulator, and some of them, like DT's work in the document player.

I think all of them work in the Document Player.

356
TI-Nspire / Re: LunaGUI - A Linux GUI Tool to use Luna
« on: August 16, 2011, 02:16:30 pm »
Btw, on mac, it complains because there is no valid x64 arch executable included

Did you read the topic name?

@Jim, I will try and add Drag/Drop support too, thanks for suggesting!

357
TI-Nspire / Re: LunaGUI - A Linux GUI Tool to use Luna
« on: August 16, 2011, 01:22:07 pm »
Great work! Just a suggestion, though: to make it look better, move the "TNS Filename" input box so it lines up horizontally with the one above it, and extend both to the end of the window.

Thanks for the suggestion!

I already made it:



358
TI-Nspire / Re: Reversi/Othello: DT's other 2011 contest entry
« on: August 16, 2011, 12:30:43 pm »
mm. Well, too late now :/

By the way, remember you can always play it online here! Half my time was spent on making it compatible with the online player, and I don't want that to go to waste :D

Well, I can't play it there XD It's Windows/Mac OS  only. I think, though, that it should be played on calculators (Real hardware) when judged.

359
TI-Nspire / Re: My Nspire Contest Lua Entry : ImprovedSoloPong
« on: August 16, 2011, 12:28:03 pm »
Well Adriweb, I'm not Juju but I don't know how "legal" it is to submit an entry after the time is over. I have, though, played the game and it looks good, nice job.

360
TI-Nspire / LunaGUI - A Linux GUI Tool to use Luna
« on: August 16, 2011, 10:16:41 am »
After Adriweb made a Mac Application to make it easier to use Luna with a simple GUI interface, I decided to make a Linux version together with Spyro.

Mine uses Python and wxPython, and below is a screenshot of it on Ubuntu 11.04:



Note, though, that in order to use this tool, you need "luna" on the same directory as the attached file. Luna was made by ExtendeD, so it's not attached with LunaGUI. To run LunaGUI, you need Python 2.6 or Python 2.7 and wxPython 2.8.

Pages: 1 ... 22 23 [24] 25 26 ... 424