alun groome

Greenhorn
+ Follow
since Jan 21, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by alun groome

Hi,

What are the key difference with graphics and java 2d??

am i also right in saying,when using just Grpahics, you cannot manipulate shape objects to different colour as and when needed like you can with java 2d graphics???

Thanks
18 years ago
Hi,

Could people please reply with their experiences using Java 2d Graphics, in terms of good and bad perfromance. I need to survey the results.

Thanks in advance
19 years ago
also how do i go abouts only painting a certain area of the screen? Im afraid I have not had much experience with java 2d graphics.

thanks
19 years ago
thanks for the reply every one. I could perhaps email the code, to demostarate what im doing?

thanks again
19 years ago
thanks for the reply, I tried your code out, and i am still having the exact same problem???

cheers
19 years ago
hi,

I basically have 2 problems now. Firstly the image doesnt appear on the Panel unless I resize the window, and when i move the dialog box off the screen, the image gets erased. similar to the eraser in paintbrush. I have tried doing repaint() and nothing.

And finally, the functionality is lost in the main frame when i close the dialog box

please help!!

thanks

This is a code snippet from the JFRAME that calles the dialog

class ButtonActionListener
implements ActionListener {
public void actionPerformed(ActionEvent event) {

DialogBox dialog = new DialogBox (frame, true);
dialog.setSize(100,100);
dialogsetVisible(true);



}
}

This is a snippet of the dialog. I have called this class DialogBox

private void buildGui() {

GridBagConstraints gc = new GridBagConstraints();

Container c = this.getContentPane();

c.setLayout(new GridBagLayout());

this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);


ImageIcon image;

String image= getPic(1);


ImageIcon icon = new ImageIcon(getClass().getResource(image));

JLabel iconLabel;

iconLabel = new JLabel(icon);

JPanel panel = new JPanel();

panel .add(iconLabel, BorderLayout.NORTH);
JButton button = new JButton("Answer");
gc.gridx = 0;
gc.gridy = 0;

c.add(panel , gc);

gc.gridx = 0;
gc.gridy = 1;
gc.ipady = 0;

c.add(button, gc);


this.pack();

}
19 years ago
Hi, im getting a stackoverflow error on the below scenario. Can anybody help?
Thanks in advance


19 years ago
Hi,

ive been working on a project, that requires heavy use of java 2d graphics. My code is probably infact 6000 lines. There is the need fora hell of alot of IF ELSE statements in the graphics method. The performace of my application is absolutley shocking. The application seems to take alot of system resources. For example, just dragging the JFRAME window along the desktop will reult in the frame moving in slow motion. And performace in the application is not great either. Everything seems to be so slow. I have also tried runign the application telling java to use more system memory using the Xms command. Does anybody have any suggestions for a possible solution to this problem?

Thanks in advance
19 years ago
is there any easy way to generate random numbers in a certain range??

thanks in advance
19 years ago
thanks for the rpely. I have seen this API. and to tell you the truth, I cannot make any sense of it.....


Cheers
19 years ago
Hi,

I have developed an application, a virtual keyboard. I now want to write something that will accept midi output from my real life keybaord. Does anybody have and good starting points. Also is there any app around where i can test to see if the midi out on my keybaord to midi in on my computer is working?

thanks
19 years ago
Hi ,

im trying to use a gridbag constraing layout.

I want to add 2 Jpannels and 2 Jbuttons. But the panels do not appear on the screen just the buttons. All other layout managers add my panels fine.

any ideas?
JInternalFrame fr1 =
new JInternalFrame("app", true, true);
fr1.setBounds(0, 05, 900, 900);
Container cn = fr1.getContentPane();
cn.setLayout(new GridBagLayout());

GridBagConstraints c = new GridBagConstraints();

c.gridx=0;
c.gridy=0;
cn.add(a,c); //button

c.gridx=0;
c.gridy=1;
cn.add(b,c); //button

c.gridx=0;
c.gridy=2;
cn.add(ca,c); //button

c.gridx=0;
c.gridy=3;
cn.add(a,c); //button

c.gridx=1;
c.gridy=1;
cn.add(panelb,c); //panel

c.gridx=1;
c.gridy=2;
cn.add(panela,c); //panel
19 years ago
Hi,

Is there anyway of forcing a panel to repaint straight away? I have 2 panels. When somethign happens on one pannel, I want the other pannel to display the changes.

thanks in advance
19 years ago
Hi,

Is there anyway of forcing a panel to repaint straight away? I have 2 panels. When somethign happens on one pannel, I want the other pannel to display the changes.

thanks in advance
19 years ago
Hi,

Im alittle new to GUI programming. Is it possible to add a pnel to an internal frame>?

I have created a panel in a class of its own called myPanel. If it is possible to add the panel to the internal frame, how would I do this??

thanks in advance

public class GUI extends JFrame {
public Integer LAYOUT_FRAME_LAYER = new Integer(1);

public GUI() {
super("Music Theory application");
setSize(500, 460);
JDesktopPane desktop = new JDesktopPane();
getContentPane().add(desktop);

JInternalFrame fr1 =
new JInternalFrame("Java Piano",true,true);
fr1.setBounds(10,10,150,150);
Container c = fr1.getContentPane();
c.setLayout(new FlowLayout());


//add panel here??


desktop.add(fr1,0);
fr1.show();


}
19 years ago