SEARCH YOUR SOLUTION HERE  

pop up fields from database

I want field on popup from database

Posted On: Tuesday 27th of November 2012 12:38:14 AM Total Views:  2253
View Complete with Replies




Related Messages:

refresh parent page after popup closes   (156 Views)
: I have the following div popup window: the popup is opened from its parent page with the following onclick event: Now when the popup is closed, I would like the parent page to automatically refresh. I would appreciate some help on this. To close the popup, the following is invoked:
popup calendar include in jsf   (137 Views)
Hi Im looking for any popup calendar like where I may select previous, present or future date like datetimepick to include in my jsf page. But Im failure to do it. So here Ive attached code of my project to show where I need to add to run calendar properly. Here same text boxes are using to display search result, add data, update data & delete data also. So anyone can help me to solve this problem please please, it's really urgent. THANKS IN ADVANCE
creating pop up box in chat applicaiton   (150 Views)
Hi I am developing a chat client which can connect to gtalk and facebook.I was able to successfully authenticate and chat.Now am building the UI for the same. I am using jsp and servlets for the purpose.I am populating the users inside select tag.Now i want a pop up box to open upon clicking the user... I used window.open(xxx.jsp).But it does not work. Can anyone tel me how to proceed How do i create a pop up box upon clicking on a user
.jnlp shows text instead of popping up   (167 Views)
If you go to: http://sodadome.com/sodaconstructor/constructor.jnlp You will see some text in Java. Now I have made an exact mirror - here See how it pops up open asking for either "Open" or "Save to Disk" Well mine, won't do that. I don't know what, it is the SAME EXACT files.
popup calendar include in jsf   (131 Views)
Hi Im looking for any popup calendar like where I may select previous, present or future date like datetimepick to include in my jsf page. But Im failure to do it. So here Ive attached code of my project to show where I need to add to run calendar properly. Here same text boxes are using to display search result, add data, update data & delete data also. So anyone can help me to solve this problem please please, it's really urgent. THANKS IN ADVANCE
Unable to pass value from one jsp to popup jsp   (205 Views)
Hi I am unable to pass value from one jsp to popup jsp. Code function showDetails(detailsForm) { detailsForm.sltdUser.value = selectedUserID; alert('selectedUserID :' + detailsForm.sltdUser.value); // works fine window.open('showDetails.jspabc =' + detailsForm.sltdUser.value); } showDetails.jsp selectedUserID is a global javascript variable. The alert is working fine bit the value in jsp is null. please help.
query to populate a drop-down   (133 Views)
I have an idea how to do this, but never did it before heres my code: City: here's my query: SELECT distinct state FROM ols_weather_current ORDER BY 1 asc; Connection connection; PreparedStatement pstmt; ResultSet rst2; try { // execute the query connection = DataBaseConnectionManager.getConnection(); String sqlQuery = "SELECT distinct state FROM ols_weather_current ORDER BY 1 asc"; pstmt = connection.prepareStatement(sqlQuery); ResultSet rst2; rst2 = pstmt.executeQuery(sqlQuery2); %> State: ; Im not sure how to set up the while statement...any help would be appreciated thanx
jpopupmenu action listner not working, desperately needed help   (156 Views)
I am using jpopupmenu in an APPLET. how to add action listener for this jpopupmenu. i tried using contentpane(), but it is not working. import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.PrintStream; import netscape.javascript.JSObject; import javax.swing.*; import java.awt.event.*; public class htmlMenu extends JApplet implements ActionListener { public void init() { Container content_pane = getContentPane (); content_pane.setLayout (new FlowLayout ()); try { winLocal = JSObject.getWindow(this); } catch(Exception _ex) { System.out.println("Error: Applet cannot get window name. \nThis error will throw unhandled exceptions.\nMake sure you have the MAYSCRIPT attribute in your object or applet tag!"); } paramItemCap_ = getParameter("itemcap"); paramDisableList_ = getParameter("disable"); paramCommonFunction_ = getParameter("commonfunction"); boolMenuEnabled = true; if(paramItemCap_ != null && paramItemCap_ != "") intItemCap = Integer.parseInt(paramItemCap_) + 1; System.out.println("Item Cap Value :" + intItemCap); mnuMain = new JPopupMenu(); mnuSub = new JMenu[intItemCap]; mnuItem = new JMenuItem[intItemCap]; strAryFunctions = new String[intItemCap]; if(!getNextParam(1)) { intItemCap = 0; intLenDisableList = 0; } for(x = 1; x < intItemCap; x++) { intMaxItemID = x; intMenuParentID = Integer.parseInt(strMenuData.substring(0, intDLoc1)); strMenuLabel = strMenuData.substring(intDLoc1 + 1, intDLoc2); strMenuFunction = strMenuData.substring(intDLoc2 + 1); if(strMenuFunction.length() < 1) strMenuFunction = paramCommonFunction_; if(strMenuLabel.equals("-")) buildSeparator(intMenuParentID); else if(strMenuFunction.equals("none") || strMenuFunction.equals("submenu")) { mnuSub[x] = new JMenu(strMenuLabel); mnuSub[x].addActionListener(this); if(intMenuParentID == 0) mnuMain.add(mnuSub[x]); else mnuSub[intMenuParentID].add(mnuSub[x]); } else if(strMenuFunction.equals("url")) { menuURL = getParameter("url" + x); dlLoc = menuURL.indexOf("|"); if(dlLoc != -1) { strTemp = menuURL.substring(dlLoc + 1); menuURL = menuURL.substring(0, dlLoc); if(strTemp.equals("_top")) { strPre = "top.location.href='"; strPost = "';"; } else if(strTemp.equals("_new")) { strPre = "window.open('"; strPost = "','NewWindow');"; } else { strPre = "top." + strTemp + ".location.href='"; strPost = "';"; } } else { strPre = "location.href="; strPost = "';"; } strAryFunctions[x] = strMenuFunction; mnuItem[x] = new JMenuItem(strMenuLabel); mnuItem[x].setActionCommand(strPre + menuURL + strPost); if(intMenuParentID == 0) mnuMain.add(mnuItem[x]); else mnuSub[intMenuParentID].add(mnuItem[x]); } else { strAryFunctions[x] = strMenuFunction; mnuItem[x] = new JMenuItem(strMenuLabel); mnuItem[x].setActionCommand(strMenuFunction); if(intMenuParentID == 0) mnuMain.add(mnuItem[x]); else mnuSub[intMenuParentID].add(mnuItem[x]); } if(!getNextParam(x + 1)) x = intItemCap; } content_pane.add(mnuMain); if(paramDisableList_ != null && paramDisableList_.length() > 0) { paramDisableList_ += ","; strItemID = "0"; intLenDisableList = paramDisableList_.length(); for(x = 0; x
Adding different popup menus to different buttons.   (147 Views)
I am making a game and I am stuck on something. In a loop I want to fill buttons with data from an Vector. Each one should have a different JPopupMenu on right click. If the item is a sword, and I right click on the button, it should say Equip sword and Destroy sword. Item Class Code: import java.util.Vector; public class Item { protected String weaponName, modifierType, classType; protected int damage, levelReq; protected static Vector allWeapons = new Vector(); protected static Vector allItems = new Vector(); //default constructor initializes weapons and items----> Item() { initWeapons(); } //constructor for weapons creation---------------------> Item(String _Name, String _Modifier, String _class, int _level, int _damage){ setName(_Name); setModifierType(_Modifier); setClass(_class); setLevel(_level); setDamage(_damage); } //initialize all of the games weapons------------------> public void initWeapons(){ Item s = new Item("Sword", "Normal", "Swordsman", 1, 3); Item ar = new Item("Bow", "Normal", "Archer", 1, 3); Item ac = new Item("Staff", "Normal","Acolyte", 1, 3); Item s2 = new Item("Straight Sword", "Normal", "Swordsman", 3, 5); Item ultraBlade = new Item("Dark-Chasm Staff", "Flame", "NONE", 30, 60); for ( int i = 0; i < 23; i ++) allWeapons.add(ultraBlade); allWeapons.add(s); allWeapons.add(ar); } //set functions---------------------------------------> public void setName(String _Name) { weaponName = _Name; } public void setModifierType(String _Modifier){ modifierType = _Modifier; } public void setDamage(int _damage){ damage = _damage; } public void setClass(String _class) { classType = _class; } public void setLevel(int level) { levelReq = level; } //get functions--------------------------------------> public String getName() { return weaponName; } public String getModifier(){ return modifierType; } public String getClassType(){ return classType; } public int getLevel(){ return levelReq; } public int getDamage(){ return damage; } } Inventory Class Code: import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; import java.util.*; public class Inventory { private static int inventorySize = 25; private int capRemaining; private JButton[] inventorySlot; protected static Vector inventory = new Vector(inventorySize); public JMenuItem destroy, equip; public JPopupMenu popup; //Constructor for making users inventory--------------------> public Inventory(int _inventorySize){ setSize(_inventorySize); for(int i = 0; i < 25; i ++) inventory.add(Item.allWeapons.elementAt(i)); createButtons(); } //Create buttons--------------------------------------------> public void createButtons(){ inventorySlot = new JButton[inventorySize]; //Inner class to handle buttons clicked-----------------> class InventoryHandler implements ActionListener{ public void actionPerformed(ActionEvent e){ Object source = e.getActionCommand(); System.out.println(source); } } class popupHandler extends MouseAdapter { public void mousePressed(MouseEvent e) { maybeShowPopup(e); } public void mouseReleased(MouseEvent e) { maybeShowPopup(e); } private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(e.getComponent(), e.getX(), e.getY()); } } } //Fill buttons with Item Data---------------------------> for (int i = 0; i < inventory.size(); i++) { inventorySlot[i] = new JButton(inventory.elementAt(i).weaponName); inventorySlot[i].setToolTipText("Required Level: " + inventory.elementAt(i).levelReq + "\n **Weapon name: " + inventory.elementAt(i).weaponName + "\n **Weapon modifier: " + inventory.elementAt(i).modifierType + "\n **Attack: +" + inventory.elementAt(i).damage + "\n **REQUIRED LEVEL: " + inventory.elementAt(i).levelReq + "\n **REQUIRED CLASS: " + inventory.elementAt(i).classType); GUI.mInventoryPanel.add(inventorySlot[i]); equip = new JMenuItem("Equip " + inventory.elementAt(i).weaponName); destroy = new JMenuItem("Destroy " + inventory.elementAt(i).weaponName); popup = new JPopupMenu(); popup.add(equip); popup.add(destroy); inventorySlot[i].addActionListener(new InventoryHandler()); inventorySlot[i].setMnemonic(i); inventorySlot[i].addMouseListener(new popupHandler()); } //Fill the rest with Empty------------------------------> for (int i = 0; i < getCapRemaining(); i++) { inventorySlot[i] = new JButton("empty"); GUI.mInventoryPanel.add(inventorySlot[i]); } } //Set Inventories size--------------------------------------> private void setSize(int _inventorySize){ inventorySize = _inventorySize; } //Get inventory size----------------------------------------> private int getSize(){ return inventorySize; } //Get capacity remaining of inventory-----------------------> private int getCapRemaining(){ return capRemaining = getSize()- inventory.size(); } //remove an item from the inventory-------------------------> private void removeAt(int location){ inventory.remove(location); } } Right now I have just stupid items filling the array for testing. I tried setting up a JPopupMenu[] but I couldn't think of a way to do it to return to the popupHandler class... I set the mnemonic as a reference to which button it is in order. I couldn't find a way to use that either. I honestly want to learn how to figure this out for future use. Thank you in advance.
Run time error popping up for my FullDeck arrary class   (156 Views)
Hi I created two classes. one Card class which basically specifies what type of data a Card object would have (Suit values and suit numbers). The other one is the Full Deck class which is basically meant to create 52 Card objects (which consist of all 52 cards in a Full Deck). I have used arrays in Full Deck. BOTH CLASSES COMPILE FINE. WHEN I RUN THE APPLICATION (FULLDECK), it STOPS EXECUTING DUE TO A RUN TIME ERROR! I am a beginner in Java, so I am trying to figure out whats the cause. Can someone please tell what the cause for the runtime error is and what can be done to correct it The Card class is as follows Code: //Importing JOptionPane import javax.swing.JOptionPane; //Class Declaration public class Card { //Declaration of variables private String suitValue = new String(); private String rankValue = new String(); //getter method for the Suit public String getSuit() { return suitValue; } //getter method for the Rank public String getRank() { return rankValue; } //setter method for the Suit public void setSuit(int suit) { switch(suit) { case 1: suitValue= "Hearts"; break; case 2: suitValue="Diamonds"; break; case 3: suitValue="Spades"; break; case 4: suitValue="Clubs"; break; //If this displays, it means there is a bug in this program default: JOptionPane.showMessageDialog(null, "Hmmm... This seems to be an invalid value"); } } //setter method for the Rank public void setNumbers(int rank) { switch(rank) { case 1: rankValue="Ace"; break; case 2: rankValue="2"; break; case 3: rankValue="3"; break; case 4: rankValue="4"; break; case 5: rankValue="5"; break; case 6: rankValue="6"; break; case 7: rankValue="7"; break; case 8: rankValue="8"; break; case 9: rankValue="9"; break; case 10: rankValue="10"; break; case 11: rankValue="Jack"; break; case 12: rankValue="Queen"; break; case 13: rankValue="King"; break; //If this displays, it means there is a bug in this program default: JOptionPane.showMessageDialog(null, "Hmmm... This seems to be an invalid value"); } } } The FullDeck class is as follows: Code: //Importing JOptionPane import javax.swing.JOptionPane; //Class Declaration public class FullDeck { //Main Funtion public static void main(String[] args) { //Declaration of variables int suit, suit2; String userCard = new String(); String computerCard = new String(); final int CARDS_IN_SUIT = 13; final int RANDOM_SUIT = 4; Card[] cardDeck = new Card[52]; int x; for(x=0;x
populating grid with data   (166 Views)
Hi all! I would like to know how to populate the grid cells in jsp with data from oracle database Please help me out
problem writing action listener for jpopupmenu   (287 Views)
i am new to this.please help me on this. I have a jpopupmenu, it has submenus. I have to implement this in an applet. Like File Edit Help New -> item1 item2 item3 Now i have to write ActionListeners for item1,item2,item3. JPopupMenu does not support addActionListener. how can i write action listener now
Data is not populated in the file in a proper format   (155 Views)
, While running the existing code (Below given) I am getting output Output Test.txt 00000029, Pistler, Richard 00000034 ,Townley ,Gary But I want the deed output in the test.txt file like Output Test.txt 00000029 Pistler Richard 00000034 Townley Gary That means pernr _WIDTH is 10 char. For example If it retrives 8 chars from database then 00000034 with two spaces. Similarly laname if it retrives 7 chars from the database then Pistler with 8 spaces. Please suggest me how can I handle it from java level. Please suggest me if there is any function behaving like this. private static final int pernr _WIDTH = 10; private static final int laname _WIDTH = 15; private static final int fname _WIDTH = 15; view plaincopy to clipboardprint PreparedStatement ps = con.getPreparedStatement(sqlTXTQuery); ResultSet rs = con.executeQuery(); if (rs.next()) { File txtFile = new File(Constants.getProperty("EZS_GENERATED_FILE") + "/" + fileName); System.out.println("The file name is"+txtFile); out = new PrintWriter(new BufferedWriter(new FileWriter(txtFile))); String pernr = rs.getString("PER_NR"); String lname = rs.getString("LNAME"); String fname = rs.getString("FNAME"); String txtLine = pernr + "," + lname + "," + fname; out.println(txtLine); } PreparedStatement ps = con.getPreparedStatement(sqlTXTQuery); ResultSet rs = con.executeQuery(); if (rs.next()) { File txtFile = new File(Constants.getProperty("EZS_GENERATED_FILE") + "/" + fileName); System.out.println("The file name is"+txtFile); out = new PrintWriter(new BufferedWriter(new FileWriter(txtFile))); String pernr = rs.getString("PER_NR"); String lname = rs.getString("LNAME"); String fname = rs.getString("FNAME"); String txtLine = pernr + "," + lname + "," + fname; out.println(txtLine); }
Open popup after Jsp page is loaded   (156 Views)
all, I want to open a popup immediately after a JSP page is loaded. Please note that i do not want it to be opened onLoad(). I want it to be opened after the jsp page is loaded. Any pointers... Thank you in anticipation. Manish...
repopulating JLists?   (151 Views)
I am making a program that auto clears and then repopulates a JList depending on what you have done. I have managed to clear all the entries in the JList but can't seem to add any Code: private static ConstantsS[] = {}; private static VariablesS[] = {}; private void VarConUpdate() { ConstantsList.remove(); VariablesList.remove(); //what i want to do is put all of the VariableS[] in VariablesList //and all ConstantsS[] ConstantsList //how would I achieve this } public GUIOutput() { JScrollPane ScrollPaneConstants = new JScrollPane(); ScrollPaneConstants.setBounds(636, 30, 126, 320); getContentPane().add(ScrollPaneConstants); ConstantsList = new JList(); ScrollPaneConstants.setViewportView(ConstantsList); ConstantsList.setVisibleRowCount(5); }
jtextfield population help   (157 Views)
Lets say I have a JPanel called JPanel1. It contains 17 jtextfields named ISA01..ISA17 Now I have a array of 17 strings and I wish to populate the jtextfields with the string values using something like: for (x = 1;x
Java/JDK Variables messed up- HELP PLEASE   (158 Views)
. I am running Windows Vista. I have Java JRE and JDK. I need Java to work, I keep getting it's not recognized. It is installed, and my variables must not be right. Can anyone help me
Help needed to change both set of images in programe when up/down button is pressed.   (165 Views)
Hi , would appreciate some help here. The below is part of the codes of my image matching programme. The programme loads 2 different series of images in the area and the up/down button is supposed to change each set of the series of images. Currently, the codes only allow one set of the images to be changed. Any idea what can be done so that both set get changes when the up/down key is pressed
how can I update IBM Hot Media javascript that used to work?   (178 Views)
I have a large number of instructional pages (written in 2000) which use IBM HotMedia (no longer available). HotMedia is written in java and no longer works. I think I am stating that correctly ... Sample page: http://instruction.cvhs.okstate.edu/...fr/HiFRp09.htm There are a number of images which, when clicked, will pop up a small window showing additional additional information/images. Some of the small windows work properly and they do not call IBM HotMedia. How can I get them working again without having to remake many, many pages Thank you for any illumination you might shed - especially if it prevents discarding several years of intensive development.
use super or this for referencing a protected element of parent   (146 Views)
Say i have two classes: Code: public class A { protected String name; } public class B extends A { // here i want to use the name defined in the parent, how should i reference it // should i use super: super.name; // or should i use this this.name; } which one is better and why Both work correctly!