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 ... 15 16 [17] 18 19 ... 424
241
Miscellaneous / Re: Birthday Posts
« on: September 16, 2011, 01:40:24 pm »
It's {AP}'s birthday right? Congratulations!

242
Web Programming and Design / Re: Vanthia Open Beta [javascript mmorpg]
« on: September 16, 2011, 01:39:27 pm »
I have tried it, it's pretty cool. I like it that you chose Facebook, but you don't have those Profile Spam messages :D

243
I think the PrizmCity one is a mockup :S Or maybe I'm wrong :P

244
Other Calculators / Re: TI-Nspire 84+ emulator - hate it.
« on: September 15, 2011, 04:28:23 pm »
Seriously, I don't understand. I use and abuse mine and never had any issues. My only problem is not being able to play thepenguin77's Chess, because it uses crystal timers, but no more problems.

Did you try any programs that don't work on it, such as thepenguin77's Chess?

245
Khavi / Re: Khavi: Java on the Prizm
« on: September 15, 2011, 01:14:24 pm »
In case anyone missed the announcement in the updates thread, I had a bit of an accident with my hard drive and the entire source was deleted. I've had to restart from basically nothing.

That's too bad, you should always make backups... In fact, the best way is to have a repository...

246
Computer Programming / Re: Java Panel/Frame has different sizes
« on: September 15, 2011, 09:40:16 am »
I have several files on my code, so asking for help is a bit complicated.

So I made this pastebin to get help. It has all the 4 files, don't worry, it's not a uber-project yet.

I tried packing the frame and constraining the size of the panel AND the frame, but I still get a different size now and then.

It's like:
Correct Size
Correct Size
Correct Size
Wrong Size
Correct Size
Correct Size
Wrong Size

247
Other / Re: Windows 8 pre-beta released
« on: September 14, 2011, 04:02:10 pm »
What about the Terminal, was it updated? Also, is there an easier way of installing programs, like "Windows Software Manager"? Stuff  like that could help me start dual-booting, but without it, I don't see the use of Windows.

248
Computer Programming / Re: Java Panel/Frame has different sizes
« on: September 14, 2011, 07:31:04 am »
I tried your code JL235, but it still doesn't work. Here's MainFrame.java:

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

import javax.swing.JFrame;

@SuppressWarnings("serial")
public class MainFrame extends JFrame {

  public MainFrame(String string) {
     this.setTitle(string);
     Dimension size = new Dimension(850, 600);
     this.setSize(size);
     this.setMinimumSize(size);
     this.setMaximumSize(size);
     this.setPreferredSize(size);
     this.setResizable(false);
     this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public void run() {
    this.setVisible(true);
  }
}

Thanks :)

@nemo
System.out.println(getParent());
System.out.println(mainFrame);

Where? ;)

249
Computer Programming / Re: Why does it gives me error?
« on: September 14, 2011, 02:57:33 am »
You need to use a Debugger. Not sure if there's a Debugger for Microsoft C++. So I recommend using C++ instead of Visual C++.

Install Code:Blocks with MingW + GDB Debugger and you can debug the program ;)

250
Other / Re: Windows 8 pre-beta released
« on: September 14, 2011, 02:53:28 am »
I was watching some videos on Windows 8 the other day. I'm not a Windows user, but it looks much better than Windows 7. Faster boot time, compatibility on more devices, they will no longer use NTFS file system, etc.

251
Miscellaneous / Re: which android phone should i buy?
« on: September 13, 2011, 06:51:42 pm »
I recommend the Galaxy S, I have tried it on a local shop and it's awesome :D

The Xperia Play has Minecraft though, not sure if you play/like it.

252
Miscellaneous / Re: Coding Font
« on: September 13, 2011, 03:30:01 pm »
Quote
N++ isn't an IDE.

It can be used as one though. There are several plugins that can turn it into an IDE. Actually, it works as a PHP IDE by default because you can send files using the FTP Client.

Quote
What's wrong with VS?  For C# and VC it is quite the bomb, nothing can compare.

The problem with Visual Studio is that it encourages developers to make programs that work solely on Microsoft Windows. This is not necessarily a problem, but sometimes it is, because programmers lose clients if their programs are not supported by many platforms.

253
Computer Programming / Re: Picture Rotating
« on: September 13, 2011, 02:19:12 pm »
AffineTransform, that's just what I need. Thanks! Also +1 for the detailed answer JL235.

254
News / Re: Omnimaga Rules Update
« on: September 13, 2011, 02:07:14 pm »
Quote from: Old Portuguese Rules
2: Comentários negativos/destrutivos/mal-educados em direção ao projecto de um utilizador ou programa baseados no tamanho do programa, quantidade de sub-programas ou linguagem de programação/livrarias usada(as), com o objectivo de desencorajar o utilizador. Críticas aos projetos/programas devem ter como objetivo fazer com que o projeto dessa pessoa seja melhor na sua forma atual.

Quote from: New Portuguese Rules
2: Comentários negativos/destrutivos/mal-educados em direção ao projecto de um utilizador ou programa baseados no tamanho do programa, quantidade de sub-programas ou linguagem de programação/livrarias usada(as) ou métodos de escrita de código, com o objetivo de desencorajar o utilizador. Críticas aos projetos/programas devem ter como objetivo fazer com que o projeto dessa pessoa seja melhor na sua forma atual.

There you go, updated Portuguese rules. Please, one of administrators, update them ;)

255
Computer Programming / Java Panel/Frame has different sizes
« on: September 13, 2011, 12:05:17 pm »
I have this code:

Code: [Select]
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

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

public class Game extends JPanel implements KeyListener {
  /* Game Panel class containing all functions */

  JFrame mainFrame = new JFrame("Game");
  boolean needs_repaint;

  public void paintComponent(Graphics g) {
    /* Draws the elements on the screen */
    super.paintComponent(g);

    System.out.printf("Panel Width: %d\n", this.getWidth());
    System.out.printf("Frame Width: %d\n", this.getParent().getWidth());

    /* Repainting has finished */
    needs_repaint = false;
  }

  public void update() {
    /* Main game loop */
   
    /* Always repaint */
    //this.repaint();
  }

  public void run() {
    /* Displays the frame, start the game */
    mainFrame.setVisible(true);
    this.requestFocus();
  }

  public Game() {
    /* Defines the frame and the game panel */
    this.setFocusable(true);
    this.addKeyListener(this);

    /* Fixed Layout frame */
    mainFrame.setSize(852, 600);
    mainFrame.setResizable(false);
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.getContentPane().add(this);   // Add game panel to main frame

    /* Start timer with main game loop */
    Timer timer = new Timer(25, new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        update();
      }});
    timer.start();
  }

  /* Game Class is not abstract, and these functions are not needed */
  public void keyPressed(KeyEvent key) {}
  public void keyReleased(KeyEvent arg0) {}
  public void keyTyped(KeyEvent arg0) {}
 
  public static void main(String[] args) {
    new Game().run();
  }
}

Basically, what happens is that the frame and the panel not always have the same width. This happens in my game Falling Blocks and with the above code as well. Below is what happened when I ran the program several times (it's a bit random, sometimes it has 850, other times it has not).

I have no idea of how to fix this, since my code supposedly gives the frame a fixed size of 852.

Quote
david@davidbuntu:~/temp$ java Game
Panel Width: 850
Frame Width: 850
Panel Width: 850
Frame Width: 850
Panel Width: 842
Frame Width: 842
Panel Width: 850
Frame Width: 850
david@davidbuntu:~/temp$ java Game
Panel Width: 850
Frame Width: 850
Panel Width: 850
Frame Width: 850
david@davidbuntu:~/temp$ java Game
Panel Width: 850
Frame Width: 850
Panel Width: 850
Frame Width: 850
david@davidbuntu:~/temp$ java Game
Panel Width: 836
Frame Width: 836
Panel Width: 842
Frame Width: 842
Panel Width: 836
Frame Width: 836
david@davidbuntu:~/temp$

EDIT: As you can see I also set mainFrame to not resizable, so I'm not resizing it.

Pages: 1 ... 15 16 [17] 18 19 ... 424