0

Hi,

I have virtual server in EC2 Amazon. Currently I'm using pgadmin to connect to postgres db in my server.

Problem : Whenever I execute any queries (e.g DELETE), it will go on endlessly. But If you SSH into the server and check the result, the DELETE query has been successfully executed.

Please advice. Thanks.

0

[code=java]
import java.awt.EventQueue;

import javax.swing.JFrame;

public class tatat extends JFrame {

private static final long serialVersionUID = 1L;

public static void main(String args[]) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                tatat frame = new tatat();
                frame.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

public tatat() {
    super();
    setBounds(100, 100, 500, 375);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

}
[/code]

I'm new to java. I'm confused on how to bring "public tatat ()" into the main method above without writing a separate statement as shown above? Please advise. Thanks.

0

Hi there,

I'm unable to run the demos java files. I followed the ways according to the prefuse tutorial. It says,

1) Go to "build" folder
2) Launch demo of interest
java -cp prefuse.jar:demos.jar prefuse.demos.<name of demo here>

and I inputted
e.g. java -cp prefuse.jar:demos.jar prefuse.demos.TreeMap.java

Please advice.

[COLOR="Red"]*Screenshot Attached![/COLOR]

Attachments Prefuse_DemoError1.jpg 297.94 KB
0

[code=java]
/*

  • IconDisplayer.java is a 1.4 application that requires the following files:
  • images/rocketship.gif
    */

import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;

import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFrame;

/*

  • This component displays a single icon one or more times in a row. The images
  • are right-aligned, with 5 pixels padding in between. All but the rightmost
  • image are mostly transparent.
    */

public class IconDisplayer extends JComponent {
private Icon icon;

private int preferredNumImages = 2;

private int pad = 5; //space between images

private Rectangle iconRect = new Rectangle();

private Rectangle clipRect = new Rectangle();

public IconDisplayer(Icon icon, int preferredNumImages, int pad) {
this.icon = icon;
if (preferredNumImages > 0) {
this.preferredNumImages = preferredNumImages;
}
if (pad >= 0) {
this.pad = pad;
}

//Set a reasonable default border.
if (this.pad > 0) {
  setBorder(BorderFactory.createEmptyBorder(this.pad, this.pad,
      this.pad, this.pad));
}

}

public Dimension getPreferredSize() {
if (icon != null) {
Insets insets = getInsets();
return new Dimension(icon.getIconWidth() * preferredNumImages + pad

  • (preferredNumImages - 1) + insets.left + insets.right,
    icon.getIconHeight() + insets.top + insets.bottom);
    } else {
    return new Dimension(100, 100);
    }
    }

    public Dimension getMinimumSize() {
    if (icon != null) {
    Insets insets = getInsets();

    //Return enough space for one icon.
    return new Dimension(icon.getIconWidth() + insets.left

  • insets.right, icon.getIconHeight() + insets.top
  • insets.bottom);
    } else {
    return new Dimension(0, 0);
    }
    }

    protected void paintComponent(Graphics g) {
    if (isOpaque()) { //paint background
    g.setColor(getBackground());
    g.fillRect(0, 0, ...

0

[code=java]
import javax.swing.;
import java.awt.
;

public class CreateToolbar{
public static void main(String[] args) {
JFrame frame = new JFrame("Create a toolbar Which have three buttons Such as: Cut, Copy, Paste");
JToolBar toolbar = new JToolBar("Toolbar", JToolBar.HORIZONTAL);
JButton cutbutton = new JButton(new ImageIcon("cut.gif"));
toolbar.add(cutbutton);
JButton copybutton = new JButton(new ImageIcon("copy.gif"));
toolbar.add(copybutton);
JButton pastebutton = new JButton(new ImageIcon("paste.gif"));
toolbar.add(pastebutton);
frame.getContentPane().add(toolbar,BorderLayout.NORTH);
frame.setUndecorated(true);
frame.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500,400);
frame.setVisible(true);
}
}

[/code]

After I execute the above code, there was no build problem. When I run it, everything fine except, the icons was not displayed. Please advice. Thanks.

0

[COLOR="Green"]Netbeans IDE[/COLOR]
[COLOR="Green"]Eclipse IDE[/COLOR]
[COLOR="Green"]IntelliJ IDEA[/COLOR]

Which from the above the the [COLOR="Red"]BEST[/COLOR], [COLOR="Red"]USER FRIENDLY[/COLOR], [COLOR="Red"]COMPLETE[/COLOR] IDE to use to design/create GUI for Java based programs. Please advise. Thanks.

0

I doing a project about Genetic Algorithm (GA). I'm looking for some book that shows GA in Java. Please advise.

[COLOR="Green"]Books[/COLOR]
[COLOR="Red"]Websites[/COLOR]
[COLOR="Green"]Journals[/COLOR]
[COLOR="Red"]White Papers/ Publications[/COLOR]

0

[code=Java]
package midp.firstAid;

import javax.microedition.lcdui.*;

public class AboutCopy extends Basic {

public AboutCopy() 
{
    super("About Product");
    append("Copyright 2008\n " +
           "\n Nanthikesvaran\n" +
           "\n" +
           "This product based on Java Technology " +
           "to give and provide sufficient information " +
           "of a knowledge on First Aid.\n"+
           "It's still under development as it's only a " +
           "prototype of an application"
           );        
}

}

[/code]

[COLOR="Red"]Errors[/COLOR]
C:\Documents and Settings\Lord Executioner\Desktop\firstAid\AboutCopy.java:3: package javax.microedition.lcdui does not exist
import javax.microedition.lcdui.*;
^
C:\Documents and Settings\Lord Executioner\Desktop\firstAid\AboutCopy.java:5: cannot find symbol
symbol: class Basic
public class AboutCopy extends Basic {
^
C:\Documents and Settings\Lord Executioner\Desktop\firstAid\AboutCopy.java:10: cannot find symbol
symbol : method append(java.lang.String)
location: class midp.firstAid.AboutCopy
append("Copyright 2008\n " +
^
3 errors

Process completed.

[COLOR="Green"]Please Advise.[/COLOR]

0

[code=javascript]
var cBrand = document.getElementById('cBrand');
var cType = document.getElementById('cType');
var cStyle = document.getElementById('cStyle');
var cFrame = document.getElementById('cFrame');
var cGroupSet = document.getElementById('cGroupSet');

if (empty(cBrand) && empty(cType) && empty(cStyle) && empty(cFrame) && empty(cGroupSet))
{
    alert("Please Choose atleast 2 Criteria");
    return false;
}else{
       return true;
       }

[/code]

The above code is not working --------- Please advise. thx

0

Hi,

    How to this type of validation using JavaScript?

[COLOR="Green"]Scenario[/COLOR]
In my SEARCH page, user was given 5 types of field[COLOR="Red"](drop-down menu)[/COLOR] to choose from. User can select either 1, 2,3,4 or all the field's option to make a search. I know how to do validation field by field[COLOR="Red"](need to fill in the previous field before use can proceed to the next field)[/COLOR], but I don't know how to write a JSript to alert " None of the field chosen! " and if at least ONE of the field is chosen, then the user can submit his/her search. Please advise.

0

[code=html]
<html>
<head>
<script type="text/javascript">
function validateFloat()
{
var o = document.frmInput.txtInput;
switch (isFloat(o.value))
{
case true:
alert(o.value + " is an float")
break;
case false:
alert(o.value + " is not an float")
}
}

</script>
</head>
<body>
<form name="frmInput">
Enter something: <input name="txtInput" size="4">
<input type="button" value="Validate" onclick="validateFloat()"></input>
</form>
</body>
</html>
[/code]

Not working. pls help