The two examples shown below are same. Both are supposed to produce same result e.g. generate the coordinates of images displayed on JPanel.
Example 1, works perfectly (print the coordinates of images), however example 2 returning 0 for the coordinate.
I was wondering why because, I have put the setvisible (true) after adding the panel...
I would like to remove an old JPanel from the Window (JFrame) and add a new one. How should I do it?
I tried the following:
public static void showGUI() {
JFrame frame = new JFrame("Colored Trails");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(partnerSelectionPanel);
frame.setSize(600,400);
...
Hello everyone
I have a JDialog that takes a name from the user. Behind the JDialog, is an applet. I dont want the user to access that applet until he has entered the name. I tried JDialog.setAlwaysOnTop(true), but the applet throws an AccessException error. So what I did was keep a while loop that will execute JDialog.setVisible(true) ...
here is my code, i basically just did a tester for the most common listeners, which i might later use in future projects, the main problem is in the keylistener at the bottom, i am trying to re-show the frame but i think it just cant be done that way, please help
ps: no idea why the imports dont show up right.
package newpackage;
impor...
I'm trying to disable a TextView within a ViewFlipper via setVisibility to GONE and cannot get it to act like I'm wanting. My code:
switch(index) {
case 0:
//Do Stuff
findViewById(R.id.o2).setVisibility(8);
findViewById(R.id.o3).setVisibility(8);
break;
case 1:
//Do Stuff
findViewById(...