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?)
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...
Back
Top