anu johncy

Greenhorn
+ Follow
since Dec 05, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by anu johncy

Netbeans as my Editor , i create the frame an external file and call the file in main java page . I want to load the image on button click, here is the code

else if(action.equals("Image"))
{

System.out.println("Inside Image");

final ImageIcon imageIcon=new ImageIcon("E:/Anu/sec.gif");
final Image image=imageIcon.getImage();
Image grayImage = GrayFilter.createDisabledImage(image);

System.out.print("inside JTextarea \n");

repaint();
System.out.print("outside JTextarea \n");

/* MF.TxtMsg=new JTextArea(){

public void paint(Graphics g) {
System.out.print("inside paint \n");

g.drawImage(image,0 ,100,this);
super.paint(g);
}
}; */

}



public void paint(Graphics g)
{
System.out.println("Inside Paint");
g.drawImage(image, 50, 500, this);
super.paint(g);
}
10 years ago
Hai ,
I try to insert an image in a JTextArea on a button click . But the Paint(Graphics g){ } is not executing , the button click event is woking
10 years ago
Thanks for your Replay
10 years ago
hi , I am trying to input an image into a JTextArea using following code . Image is not displaying in the textarea

else if(action=="Image")
{
final ImageIcon imageIcon=new ImageIcon("E:/Anu/sec.gif");
final Image image=imageIcon.getImage();
Image grayImage = GrayFilter.createDisabledImage(image);

MF.TxtMsg=new JTextArea(){ //MailFrame MF


public void paint(Graphics g) {
System.out.print("inside paint \n");
g.drawImage(image,0 ,100,this);
super.paint(g);
}
};
System.out.print("outside JTextarea \n");
//repaint();
}

MF.Scroll = new JScrollPane(MF.TxtMsg);
Container content = MF.getContentPane();
content.add(MF.Scroll, BorderLayout.CENTER);
MF.setVisible(true);

}


10 years ago
hai,

I create one login page , the button event is not taking , the code is following




help me please

regards

Anu
12 years ago
hai,

I create one login page , the button event is not taking , the code is following


package login;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import database.DataBaseConnection;
import design.LoginFrame;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.Connection;
import java.sql.DriverManager;

//Login User -- Check Login is correct or Not
class loginSubclass extends JFrame //implements ActionListener
{
String name,password;

public loginSubclass()
{

System.out.println("Inside login subclass");
design.LoginFrame frame=new design.LoginFrame();
name=frame.txtName.getText();
password=frame.txtPass.getText();

System.out.println("Name "+name);
System.out.println("Password "+password);
frame.btnLogin.setActionCommand("login");

frame.btnLogin.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
System.out.println("You clicked the button,,,,,,,,,");
}
});



}


}



public class LoginUser {


public static void main(String[] args) {

try {
System.out.println("Login user");
loginSubclass login=new loginSubclass();
design.LoginFrame LF=new design.LoginFrame();
LF.setVisible(true);
//LF.initGUI();


}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
System.out.println(e);

}
}


}

help me please

regards

Anu
hai ,


I am using Eclipse editor for my java project , along with that now I add Windows GUI builder for esay development of GUI in my project .

In my project I use one package (design )for GUI design . Then the second package (code) for coding .
I want to access design package component into code package java code.

My problem is that I can access the component in my java code (code package). It runs I can view the components (textfield & button ) , but i can't do any actions .

Please help me to how to solve this problem


regards

anu

anu johncy wrote:
Here i am using eclipse IDE , how i can access mysql database using eclipse .

thanks & regards
Anu johncy



I got the solution


Integrate Eclipse and MYSQL

1. Install Eclipse in C:/ProgramFiles .
2. Download SQL EXplorer , and unzip in to eclipse folder, then copy sql explorer featers and plugins to eclipse fetures and plugins .
then start eclipse IDE.
3. ineclipse IDE form menu bar click Window->open prespective->others.
open prespective window will come . Select SQL Explorer.
SQl Explorer will come Eclipse IDE.

Click Create New Connection Profile window will get.

give the Name : MySql Connection (any name).
Driver click Add/Edit Drivers button prefernces window will come select JDBC driver from SQLEXplorer . select MYSQL Driver click Add button
Create a new Driver window will get .

give any name as Driver name
ie, Name : MMMYSQL
example URL: jdbc://localhost:3306/db.
select Extra class path tab
click Add jars (to add external jar files ) select mysql connector click Ok .
prefernce window select MMMySql Driver and click Ok
in create new connection profile window select Driver
check auto ligin

give user name : root
passowrd: root (if given in Mysql data base).
check Auto commit.
finaly click Ok button .

Here i am using eclipse IDE , how i can access mysql database using eclipse .

thanks & regards
Anu johncy
Hai friend ,

In my Java program (using Eclipse IDE),i want to connect mysql .

I download and install Eclipse in (C:\ProgramFiles)
I download and install Mysql .
I download Mysql Connector .

But I can not use data base in my java program


thanks
regards ,
hi ,
i try to create simple login page using Eclipse Editor
the code is following :

EclipseClass.java

and one externel classfile having the same package that code is following :

NextPage.java

then the error is
java.lang.ClassCastException: eclipsepackage.Login cannot be cast to javax.swing.event.AncestorListener

please support me to solve problem ,
thanks ,

[Edit - added code tags - MB]
13 years ago