Brijesh Sah

Greenhorn
+ Follow
since Jan 22, 2009
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 Brijesh Sah

I am editing my question. Please go through my problem and give me a solution.

MainForm.java // This class will display the main window and it will act as MDI form






I am not getting the minimize or iconifiable button on the screen. Neither I am able to resize the window. Please help.

If you can give any other way to do the make MDI form in java. Then also i am fine with that.
Thanks

Brijesh
14 years ago

Code As Follows:

MainForm.java // It will display the main form with menu

package practise;


public class MainForm extends javax.swing.JFrame {

/** Creates new form MainForm */
public MainForm() {
initComponents();
}


private void initComponents() {

jContainer = new javax.swing.JDesktopPane();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
mnuCustomer = new javax.swing.JMenuItem();
mnuItem = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem3 = new javax.swing.JMenuItem();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jMenu1.setText("Forms");

mnuCustomer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
mnuCustomer.setText("Customer");
mnuCustomer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mnuCustomerActionPerformed(evt);
}
});
jMenu1.add(mnuCustomer);

mnuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
mnuItem.setText("Item");
mnuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mnuItemActionPerformed(evt);
}
});
jMenu1.add(mnuItem);

jMenuBar1.add(jMenu1);

jMenu2.setText("File");

jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
jMenuItem3.setText("Exit");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem3);

jMenuBar1.add(jMenu2);

setJMenuBar(jMenuBar1);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jContainer, javax.swing.GroupLayout.DEFAULT_SIZE, 418, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jContainer, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
.addContainerGap())
);

pack();
}

private void mnuCustomerActionPerformed(java.awt.event.ActionEvent evt) {
CustomerView cv=new CustomerView();
jContainer.add(cv);
cv.setVisible(true);
}

private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}

private void mnuItemActionPerformed(java.awt.event.ActionEvent evt) {
ItemForm iv=new ItemForm();
jContainer.add(iv);
iv.setVisible(true);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainForm().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JDesktopPane jContainer;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem mnuCustomer;
private javax.swing.JMenuItem mnuItem;
// End of variables declaration

}


then ItemForm.java // code pasted on first part
but i am not getting the buttons
is it clear or i will paste here only

14 years ago
see the attached image

in Item form no minimize and iconifiable button only close button
14 years ago
Hi All,

My code is as follows:

package practise;


public class ItemForm extends javax.swing.JInternalFrame {

/** Creates new form ItemForm */
public ItemForm() {
super("Item Form",true, true, true, true);
initComponents();
}


private void initComponents() {

setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("Item Form");
setMaximumSize(new java.awt.Dimension(800, 600));

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 394, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 278, Short.MAX_VALUE)
);

pack();
}

But Minimize and iconifiable buttons are not displaying on the JIntenalFrame.

Neither I am able to resize the window. Please help.....

Thanks
Brijesh
14 years ago
You can use java's poi jar functionality. It will work for you i guess.
15 years ago
JSP
Thanks For your replies.

15 years ago
JSP
If i want to this thing inside this method only otherwise there could me major code changes
15 years ago
JSP
is there any other way to retrieve the session object except request.getSession();


please help :
15 years ago
JSP
My Code is as follows:
void sendmail(String Mailcode,String name,String fromid,String toid,String extra){
//Some code here

name=(String)session.getAttribute("SALUTATION")+" "+name;
//Some Code Here
}

I want to add SALUTATION name before name which is set as session variable.
so that email can go like Dear Mr. Brijesh,
Please help otherwise i have to change many classes
15 years ago
JSP