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 ... 196 197 [198] 199 200 ... 424
2956
Now from now on, I'm going to have problems in the layout of the window.

I wanna make a 640*640 window with 64 panels of 80*80 as in a grid.

It's a 8*8 grid, each square panel is 80pixels*80pixels, althogether makes a 640*640 pixels window.

Any suggestions/ideas/layouts/code on how to do this?

2957
Oh damn, I just noticed, I made it JFrame, I meant JPanel. Sorry and thanks for the setLocationRelativeTo thing :)

2958
But I've seen code centering windows aka frames using setLocation(null).

My goal is to center the window.

Code: [Select]
import javax.swing.*;

import java.awt.*;

public class MainClass extends JApplet {

JFrame mainWindow = new JFrame("Axe Sprite Editor");


    public static void main(String[] args)
    {
    MainClass mainClass = new MainClass();
    mainClass.createGUI();
    }
    public MainClass()
    {
    mainWindow.setSize(640,640);
    mainWindow.setResizable(false);
    JFrame pixel1 = new JFrame();
    mainWindow.add(pixel1);
    }
    public void createGUI()
    {
    mainWindow.setVisible(true);
    }
}

I also have this code but it seems like I can't add the pixel1 panel to mainWindow, so how do I do it?:

Code: [Select]
Exception in thread "main" java.lang.IllegalArgumentException: adding a window to a container
at java.awt.Container.checkNotAWindow(Container.java:431)
at java.awt.Container.addImpl(Container.java:1039)
at java.awt.Container.add(Container.java:959)
at javax.swing.JApplet.addImpl(JApplet.java:300)
at java.awt.Container.add(Container.java:365)
at MainClass.<init>(MainClass.java:20)
at MainClass.main(MainClass.java:12)

Thanks much and sorry for disturbing you.

2959
I see Deep Thought!

I have another question, though:

I get this:

Code: [Select]
Exception in thread "main" java.lang.NullPointerException
at java.awt.Component.setLocation(Component.java:1997)
at MainClass.createGUI(MainClass.java:21)
at MainClass.main(MainClass.java:12)

When running this:

Code: [Select]
import javax.swing.*;

import java.awt.*;

public class MainClass extends JApplet {

JFrame mainWindow = new JFrame("Axe Sprite Editor");

    public static void main(String[] args)
    {
    MainClass mainClass = new MainClass();
    mainClass.createGUI();
    }
    public MainClass()
    {
   
    }
    public void createGUI()
    {
    mainWindow.setSize(640,640);
    mainWindow.setLocation(null);
    mainWindow.setResizable(false);
   
    JPanel pixel1 = new JPanel();
    mainWindow.add(pixel1);
   
   
    mainWindow.setVisible(true);
    }
}

I can't really understand why :S

2960
TI 68K / Re: Block Breaker
« on: March 12, 2011, 05:53:42 am »
jim, I think your userbar is awesome :)

2961
Other Calculators / Re: Hardware Hacking NSpire
« on: March 12, 2011, 05:31:03 am »
Oh ok, sorry I misunderstood your post. I guess it could be a temporary solution until Ndless CX is done if it looks like it could be an hard task, so people can at least examine the memory content and hardware and maybe even start coding programs before Ndless CX comes out :P (like what happened with gbc4nspire)

Exactly, but I also can't see any obvious way to open a nspire and hack it :S

2962
TI Z80 / Re: [PROJECT] SimpleCS
« on: March 12, 2011, 05:30:26 am »
Can you order one for free in France?

2963
Other Calculators / Re: Joint Spring Coding Competition
« on: March 11, 2011, 06:22:04 pm »
I don't think anybody can, 0 downloads :S

2964
Other Calculators / Re: Joint Spring Coding Competition
« on: March 11, 2011, 06:11:04 pm »
I cannot view the attachment and I do have an account and I am logged in.

2965
Introduce Yourself! / Re: Hello everybody
« on: March 11, 2011, 04:59:21 pm »
There is something involving peanuts going on...
Yup, all of the new members get peanuts. :)

Welcome to Omnimaga, yrinfish! ;D

Edit: Ninja'd...

You were ninja'd


Woops, you edited, I was ninja'd too, damn.

2966
Introduce Yourself! / Re: Hello everybody
« on: March 11, 2011, 04:58:25 pm »
There is something involving peanuts going on...

New members are given peanuts here in Omnimaga:D

2967
Axe / Re: New Tilemapping Tutorial With Example
« on: March 11, 2011, 04:32:00 pm »
1. /facepalm, read the text and the code;
2. Thanks much for the Pt-Off.

2968
Axe / Re: New Tilemapping Tutorial With Example
« on: March 11, 2011, 04:24:47 pm »
Code: [Select]
:.P+(getKey(3) and (({Z+1+GDB1}=0) or ({Z+1+GDB1}=11)))-(getKey(2) and (({Z-1+GDB1}=0) or ({Z-1+GDB1}=11)))→P
:
:.Q*24+P+101→Z
:.Q+(getKey(1) and (({Z+24+GDB1}=0) or ({Z+24+GDB1}=11)))-(getKey(4) and (({Z-24+GDB1}=0) or ({Z-24+GDB1}=11)))→Q
:

This is my first question, why are these as comments?

Also, what does Pt-Off does?

Code: [Select]
:Pt-Off(40,32,Pic1+8+(θ/4^2*8+8*(θ≠0))+{r1}
:Pt-Off(40,24,Pic1+{r1}

Like in here.

2969
Axe / Re: New Tilemapping Tutorial With Example
« on: March 11, 2011, 04:20:02 pm »
I didn't read all of it yet, but this is awesome, just pure awesome, I'm gonna learn tilemapping now (which I never learnt).

2970
Introduce Yourself! / Re: Hello everybody
« on: March 11, 2011, 04:14:09 pm »
Welcome yrinfish!

I hope you can make a topic in the 'Other Calc projects and ideas' forum for each of your projects, I can't wait to see screnies.

Hope you enjoy your time here, also I am also an Axe programmer and Axe>TI-Basic, Axe ftw.

Mistakes? "You live in Nederlands" instead of "You live in the Netherlands".

We have an user from there too! His name is aeTIos.

Pages: 1 ... 196 197 [198] 199 200 ... 424