Java [Java] what the hell am I doing wrong with this graphical interfaze?

  • Thread starter Thread starter stonecoldgen
  • Start date Start date
  • Tags Tags
    Java
AI Thread Summary
The discussion revolves around a programming issue related to a Java application that includes two packages: one for functional requirements and another for the GUI. The main class for the functional package is "FinalesCopaMundo," while the GUI package features "InterfazFinalesCopaMundo." The user encounters an error when trying to instantiate the "FinalesCopaMundo" class within the GUI class "InterfazFinalesMundiales." Initially, the line of code for creating an instance of "FinalesCopaMundo" throws an error, but adding a "throws Exception" declaration resolves the issue. The user seeks clarification on why this change worked and requests to see the "FinalesCopaMundo" class code, suggesting that the problem may be related to exception handling in that class.
stonecoldgen
Messages
108
Reaction score
0
I have a package with all the classes needed to perform the functional recquirements (calculations, etc.). It's working perfectly. The "main" class is "FinalesCopaMundo"

I have another package with all the classes needed to perform the GUI. The "main" class is "InterfazFinalesCopaMundo".

I have:

Code:
package uniandes.cupi2.finalesCopaMundo.interfaz;
import javax.swing.*;

import java.awt.*;
import uniandes.cupi2.finalesCopaMundo.mundo.*;


public class InterfazFinalesMundiales extends JFrame{

	//Atributos
	
	private PanelEquipoA panelEquipoA;
	private PanelEquipoB panelEquipoB;
	private PanelImagen panelImagen;
	private PanelInformacion panelInformacion;
	private PanelOpciones panelOpciones;
	
	private FinalesCopaMundo finalesCopaMundo; //this line is not throwing an error
	
	
	//Constructor
	
	public InterfazFinalesMundiales(){
		
	finalesCopaMundo=new FinalesCopaMundo(); //this line is throwing an error



I don't know why this is, any tips?
 
Technology news on Phys.org


OK, for some reason adding a "throws Exception" was the solution, but I don't know why, any idea?
 


Can you pst your FinalesCopaMundo class? (I assume that is where you added the throws Exception statement?)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top