Assistance needed on this code, please
The code below is an example program:
/* package demo.swing; */
import javax.swing.JFrame;
* Hello World application
* @author MAbernethy
public class HelloWorld extends JFrame
private javax.swing.JLabel jLabel = null;
private javax.swing.JTextField jTextField = null;
private javax.swing.JButton jButton = null;
public static void main(String[] args)
HelloWorld w = new HelloWorld();
w.setVisible(true);
public HelloWorld()
super();
this.setSize(300, 200);
this.getContentPane().setLayout(null);
this.add(getJLabel(), null);
this.add(getJTextField(), null);
this.add(getJButton(), null);
this.setTitle("Hello World");
private javax.swing.JLabel getJLabel() {
if(jLabel == null) {
jLabel = new javax.swing.JLabel();
jLabel.setBounds(34, 49, 53, 18);
jLabel.setText("Name:");
return jLabel;
private javax.swing.JTextField getJTextField() {
if(jTextField == null) {
jTextField = new javax.swing.JTextField();
jTextField.setBounds(96, 49, 160, 20);
return jTextField;
private javax.swing.JButton getJButton() {
if(jButton == null) {
jButton = new javax.swing.JButton();
jButton.setBounds(103, 110, 71, 27);
jButton.setText("OK");
return jButton;
The code compiles without any probems,but when run the following error messsages appear:
Exception in thread "main" java.lang.Error: Donot use HelloWorld.add() use HelloWorld.getContentPane().add() instead
at javax.swing.Jframe.creatRootPaneException(Jframe.java:465)
at javax.swing.Jframe.addImpl(Jframe.java:491)
at java.awt.Container.add(Container.java:518)
at HelloWorld.<init>(HelloWorld.java:26)
at HelloWorld.main(HelloWorld.java:17)
Donot use HelloWorld.add() use
HelloWorld.getContentPane().add() instead
Isn't that obvious enough?D'oh! That was pretty obvious... ;)Yup, but my comment was directed at the OP, and I wish he reads your answer and remembers it next time. :)
Similar Messages
-
Hi guys, I need help in debugging this code I made, which is a GUI minesweeper. Its extremely buggy...I particularly need help fixing the actionListener part of the code as everytime I press a button on the GUI, an exception occurs.
help please!
package minesweeperGUI;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MinesweeperGUI implements ActionListener
//Declaration of attributes
static int length = 0;
JMenuItem menuItemNew = new JMenuItem();
JRadioButtonMenuItem rbEasy = new JRadioButtonMenuItem();
JRadioButtonMenuItem rbHard = new JRadioButtonMenuItem();
JMenuItem menuItemExit = new JMenuItem();
JButton buttonReset = new JButton();
JButton buttonGrid[][] = null;
JFrame frame = new JFrame();
int getBombsTotal = 0;
JLabel setBombsLabel = new JLabel();
int a = 0;
int b = 0;
//No constructor created. Uses default constructor
//Create the menu bar
public JMenuBar newMenuBar()
//Sets up the menubar
JMenuBar menuBar = new JMenuBar();
//Sets up the Game menu with choice of new, grid size, and exit
JMenu menu = new JMenu ("Game");
menuBar.add (menu);
menuItemNew = new JMenuItem ("New");
menuItemNew.addActionListener (this);
menu.add (menuItemNew);
menu.addSeparator();
//Sets up sub-menu for grid size with choice of easy and hard radio buttons
JMenu subMenu = new JMenu ("Grid Size");
rbEasy = new JRadioButtonMenuItem ("Easy: 5x5 grid");
rbEasy.addActionListener (this);
subMenu.add (rbEasy);
rbHard = new JRadioButtonMenuItem ("Hard: 10x10 grid");
rbHard.addActionListener (this);
subMenu.add (rbHard);
menu.add (subMenu);
menu.addSeparator();
menuItemExit = new JMenuItem ("Exit");
menuItemExit.addActionListener (this);
menu.add (menuItemExit);
return menuBar;
//Setting up of Bomb Grid
public int [][] setGrid (int length)
int grid[][] = null;
grid = new int[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
grid[i][j] = ((int)Math.round(Math.random() * 10))% 2;
return grid;
//Setting up of the of the graphical bomb grid
public JButton[][] setButtonGrid (int length)
JButton buttonGrid[][] = null;
buttonGrid = new JButton[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
buttonGrid[i][j] = new JButton();
return buttonGrid;
//Setting up of a way to count the total number of bombs in the bomb grid
public int getBombsTotal (int length, int setGrid[][])
int bombsTotal = 0;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (setGrid[i][j] == 1)
bombsTotal += 1;
return bombsTotal;
//Create a label for number of bombs left
public JLabel setBombsLabel (int getBombsTotal)
JLabel bombsLabel = new JLabel(String.valueOf (getBombsTotal) + " Bombs Left");
return bombsLabel;
//Setting up a way to count the number of bombs around a button
public String setBombs (int length, int setGrid[][], int x, int y)
int bombs[][] = new int[length][length];
String bombsString = null;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (i == 0 && j == 0)
bombs[i][j] = setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i ==0 && j == (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else if (i == (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1];
else if (i == (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1];
else if (i == 0 && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i][j+1] +
setGrid[i+1][j-1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i == (length - 1) && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1];
else if (i != 0 && i != (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i != 0 && i != (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1] + setGrid[i+1][j-1] +
setGrid[i+1][j] + setGrid[i+1][j+1];
bombsString = String.valueOf (bombs[x][y]);
return bombsString;
//create the panel for the bombs label and reset button
public JPanel newTopPanel(int length)
int setGridNew [][] = null;
setGridNew = new int[length][length];
int getBombsTotalNew = 0;
JLabel setBombsLabelNew = new JLabel();
setGridNew = setGrid (length);
getBombsTotalNew = getBombsTotal (length, setGridNew);
setBombsLabelNew = setBombsLabel (getBombsTotalNew);
JPanel topPanel = new JPanel ();
topPanel.setLayout (new BorderLayout (50,50));
JLabel bombsLabel = new JLabel ();
bombsLabel = setBombsLabelNew;
topPanel.add (bombsLabel, BorderLayout.WEST);
buttonReset = new JButton("Reset");
buttonReset.addActionListener (this);
topPanel.add (buttonReset, BorderLayout.CENTER);
return topPanel;
//create the panel for the play grids
public JPanel newBottomPanel(int length)
JButton setButtonGridNew[][] = null;
setButtonGridNew = new JButton [length][length];
setButtonGridNew = setButtonGrid (length);
JPanel bottomPanel = new JPanel ();
bottomPanel.setLayout (new GridLayout (length, length));
buttonGrid = new JButton[length][length];
for (a = 0; a < length; a++)
for (b = 0; b < length; b++)
buttonGrid[a] = setButtonGridNew[a][b];
buttonGrid[a][b].addActionListener (this);
bottomPanel.add (buttonGrid[a][b]);
return bottomPanel;
//Overiding of abstract method actionPerformed
public void actionPerformed(ActionEvent e)
if (e.getSource() == menuItemNew)
launchFrame(length);
else if (e.getSource() == menuItemExit)
frame.setVisible (false);
System.exit(0);
else if (e.getSource() == rbEasy)
length = 5;
launchFrame(length);
else if (e.getSource() == rbHard)
length = 10;
launchFrame(length);
else if (e.getSource() == buttonReset)
launchFrame(length);
else if (e.getSource() == buttonGrid[a][b])
int setGridNew [][] = null;
setGridNew = new int[length][length];
JButton bombButton [][] = null;
bombButton = new JButton [length][length];
String bombString [][] = null;
bombString = new String[length][length];
setGridNew = setGrid (length);
bombString[a][b] = setBombs (length, setGridNew, a, b);
bombButton[a][b] = new JButton (bombString[a][b]);
if (setGridNew[a][b] == 0)
buttonGrid[a][b] = bombButton[a][b];
getBombsTotal--;
JLabel setBombsLabelNew = new JLabel();
setBombsLabelNew = setBombsLabel (getBombsTotal);
else if (setGridNew[a][b] == 1 )
buttonGrid[a][b] = new JButton("x");
JOptionPane.showMessageDialog (null, "Game Over. You hit a Bomb!");
System.exit(0);
//create the content pane
public Container newContentPane(int length)
JPanel topPanel = new JPanel();
JPanel bottomPanel = new JPanel();
topPanel = newTopPanel(length);
bottomPanel = newBottomPanel (length);
JPanel contentPane = new JPanel();
contentPane.setOpaque (true);
contentPane.setLayout (new BorderLayout(50,50));
contentPane.add (topPanel, BorderLayout.NORTH);
contentPane.add (bottomPanel, BorderLayout.CENTER);
return contentPane;
public void launchFrame (int length)
//Makes sure we have nice window decorations
JFrame.setDefaultLookAndFeelDecorated(true);
//Sets up the top-level window
frame = new JFrame ("Minesweeper");
//Exits program when the closed button is clicked
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
Container contentPane = new Container();
menuBar = newMenuBar();
contentPane = newContentPane (length);
//Sets up the menu bar and content pane
frame.setJMenuBar (menuBar);
frame.setContentPane (contentPane);
//Displays the window
frame.pack();
frame.setVisible (true);
public static void main (String args[])
//Default length is 5
length = 5;
MinesweeperGUI minesweeper = new MinesweeperGUI();
minesweeper.launchFrame(length);hi, thanks. that removed the exception; although now the buttons action listener won't work :(
here is the revised code:
To anyone out there, can you guys run this code and help me debug it?
I'm really desperate as this is a school project of mine and the deadline is 7 hours away. I have already been working on it for 3 days, but the program is still very buggy.
thanks!
/* Oliver Ian C. Wee 04-80112
* CS12 MHRU
* Machine Problem 2
package minesweeperGUI;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MinesweeperGUI implements ActionListener
//Declaration of attributes
static int length = 0;
JMenuItem menuItemNew = new JMenuItem();
JRadioButtonMenuItem rbEasy = new JRadioButtonMenuItem();
JRadioButtonMenuItem rbHard = new JRadioButtonMenuItem();
JMenuItem menuItemExit = new JMenuItem();
JButton buttonReset = new JButton();
JButton buttonGrid[][] = null;
JFrame frame = new JFrame();
int getBombsTotal = 0;
JLabel setBombsLabel = new JLabel();
int a = 0;
int b = 0;
//No constructor created. Uses default constructor
//Create the menu bar
public JMenuBar newMenuBar()
//Sets up the menubar
JMenuBar menuBar = new JMenuBar();
//Sets up the Game menu with choice of new, grid size, and exit
JMenu menu = new JMenu ("Game");
menuBar.add (menu);
menuItemNew = new JMenuItem ("New");
menuItemNew.addActionListener (this);
menu.add (menuItemNew);
menu.addSeparator();
//Sets up sub-menu for grid size with choice of easy and hard radio buttons
JMenu subMenu = new JMenu ("Grid Size");
ButtonGroup bg = new ButtonGroup();
rbEasy = new JRadioButtonMenuItem ("Easy: 5x5 grid");
bg.add (rbEasy);
rbEasy.addActionListener (this);
subMenu.add (rbEasy);
rbHard = new JRadioButtonMenuItem ("Hard: 10x10 grid");
bg.add (rbHard);
rbHard.addActionListener (this);
subMenu.add (rbHard);
menu.add (subMenu);
menu.addSeparator();
menuItemExit = new JMenuItem ("Exit");
menuItemExit.addActionListener (this);
menu.add (menuItemExit);
return menuBar;
//Setting up of Bomb Grid
public int [][] setGrid (int length)
int grid[][] = null;
grid = new int[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
grid[i][j] = ((int)Math.round(Math.random() * 10))% 2;
return grid;
//Setting up of the of the graphical bomb grid
public JButton[][] setButtonGrid (int length)
JButton buttonGrid[][] = null;
buttonGrid = new JButton[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
buttonGrid[i][j] = new JButton();
return buttonGrid;
//Setting up of a way to count the total number of bombs in the bomb grid
public int getBombsTotal (int length, int setGrid[][])
int bombsTotal = 0;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (setGrid[i][j] == 1)
bombsTotal += 1;
return bombsTotal;
//Create a label for number of bombs left
public JLabel setBombsLabel (int getBombsTotal)
JLabel bombsLabel = new JLabel(" " +String.valueOf (getBombsTotal) + " Bombs Left");
return bombsLabel;
//Setting up a way to count the number of bombs around a button
public String setBombs (int length, int setGrid[][], int x, int y)
int bombs[][] = new int[length][length];
String bombsString = null;
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
if (i == 0 && j == 0)
bombs[i][j] = setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i ==0 && j == (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else if (i == (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1];
else if (i == (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1];
else if (i == 0 && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i][j-1] + setGrid[i][j+1] +
setGrid[i+1][j-1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i == (length - 1) && j != 0 && j != (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1];
else if (i != 0 && i != (length - 1) && j == 0)
bombs[i][j] = setGrid[i-1][j] + setGrid[i-1][j+1] +
setGrid[i][j+1] + setGrid[i+1][j] +
setGrid[i+1][j+1];
else if (i != 0 && i != (length - 1) && j == (length - 1))
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i][j-1] + setGrid[i+1][j-1] +
setGrid[i+1][j];
else
bombs[i][j] = setGrid[i-1][j-1] + setGrid[i-1][j] +
setGrid[i-1][j+1] + setGrid[i][j-1] +
setGrid[i][j+1] + setGrid[i+1][j-1] +
setGrid[i+1][j] + setGrid[i+1][j+1];
bombsString = String.valueOf (bombs[x][y]);
return bombsString;
//create the panel for the bombs label and reset button
public JPanel newTopPanel(int length)
int setGridNew [][] = null;
setGridNew = new int[length][length];
int getBombsTotalNew = 0;
JLabel setBombsLabelNew = new JLabel();
setGridNew = setGrid (length);
getBombsTotalNew = getBombsTotal (length, setGridNew);
setBombsLabelNew = setBombsLabel (getBombsTotalNew);
JPanel topPanel = new JPanel ();
topPanel.setLayout (new BorderLayout (20,20));
JLabel bombsLabel = new JLabel ();
bombsLabel = setBombsLabelNew;
topPanel.add (bombsLabel, BorderLayout.WEST);
buttonReset = new JButton("Reset");
buttonReset.addActionListener (this);
topPanel.add (buttonReset, BorderLayout.CENTER);
return topPanel;
//create the panel for the play grids
public JPanel newBottomPanel(int length)
JButton setButtonGridNew[][] = null;
setButtonGridNew = new JButton [length][length];
setButtonGridNew = setButtonGrid (length);
JPanel bottomPanel = new JPanel ();
bottomPanel.setLayout (new GridLayout (length, length));
buttonGrid = new JButton[length][length];
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
buttonGrid[i][j] = setButtonGridNew[i][j];
buttonGrid[i][j].addActionListener (this);
bottomPanel.add (buttonGrid[i][j]);
return bottomPanel;
//Overiding of abstract method actionPerformed
public void actionPerformed(ActionEvent e)
if (e.getSource() == menuItemNew)
closeFrame();
launchFrame(length);
else if (e.getSource() == menuItemExit)
frame.setVisible (false);
System.exit(0);
else if (e.getSource() == rbEasy)
closeFrame();
length = 5;
launchFrame(length);
else if (e.getSource() == rbHard)
closeFrame();
length = 10;
launchFrame(length);
else if (e.getSource() == buttonReset)
closeFrame();
launchFrame(length);
else if (e.getSource() == buttonGrid[a])
int setGridNew [][] = null;
setGridNew = new int[length][length];
JButton bombButton [][] = null;
bombButton = new JButton [length][length];
String bombString [][] = null;
bombString = new String[length][length];
setGridNew = setGrid (length);
for (int i = 0; i < length; i++)
for (int j = 0; j < length; j++)
bombString[i][j] = setBombs (length, setGridNew, i, j);
bombButton[i][j] = new JButton (bombString[i][j]);
if (setGridNew[a][b] == 0)
buttonGrid[a][b] = bombButton[a][b];
getBombsTotal--;
JLabel setBombsLabelNew = new JLabel();
setBombsLabelNew = setBombsLabel (" " String.valueOf (getBombsTotal) " Bombs Left");
else if (setGridNew[a][b] == 1 )
buttonGrid[a][b] = new JButton("x");
JOptionPane.showMessageDialog (null, "Game Over. You hit a Bomb!");
System.exit(0);
//create the content pane
public Container newContentPane(int length)
JPanel topPanel = new JPanel();
JPanel bottomPanel = new JPanel();
topPanel = newTopPanel(length);
bottomPanel = newBottomPanel (length);
JPanel contentPane = new JPanel();
contentPane.setOpaque (true);
contentPane.setLayout (new BorderLayout(5,5));
contentPane.add (topPanel, BorderLayout.NORTH);
contentPane.add (bottomPanel, BorderLayout.CENTER);
return contentPane;
public void closeFrame ()
frame = new JFrame ("Minesweeper");
frame.dispose();
public void launchFrame (int length)
//Makes sure we have nice window decorations
JFrame.setDefaultLookAndFeelDecorated(true);
//Sets up the top-level window
frame = new JFrame ("Minesweeper");
//Exits program when the closed button is clicked
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
Container contentPane = new Container();
menuBar = newMenuBar();
contentPane = newContentPane (length);
//Sets up the menu bar and content pane
frame.setJMenuBar (menuBar);
frame.setContentPane (contentPane);
//Displays the window
frame.pack();
frame.setVisible (true);
public static void main (String args[])
//Default length is 5
length = 5;
MinesweeperGUI minesweeper = new MinesweeperGUI();
minesweeper.launchFrame(length); -
I would like your comments on this code. Doesn't it have a few oppertunities? I know it's jsp, but question is not directed toward the jsp, just the logic/syntax/etc. How about the == for starters?
<%
String z_Desc = (((String)hshipTrackSummaryDocList.get("Z_DESC")) == null) ? "" : (String)hshipTrackSummaryDocList.get("Z_DESC");
if (z_Desc == "" ) {
%>
<%
}else {
%>
<%=(((String)hshipTrackSummaryDocList.get("Z_DESC")) == null) ? "" : (String)hshipTrackSummaryDocList.get("Z_DESC")%></font>
<%
%>Hi mlovern! This code has several opportunities for "improvement". I noticed that the get("Z_DESC") method is called on hshipTrackSummaryDocList object several times. Each time, it returns the very same value. Hence, in the interests of efficiency, it's a better idea to call it once, save the return value and then use the latter.
Also, I'm not too clear about exactly what you intended to do in the else clause. As it stands, your else clause will cause the JSP to fail.
Be very careful while using the "==" operator while comparing strings. That causes object comparison, not object content comparison. The latter is the required test most of the time. Also, while comparing the contents of the strings, it's better to call the equals() method on the empty string or a constant string. So, if I needed to compare a test value against an empty string or a constant, here's how.
if ( "".equals( testString ) )
// do something
else if ( SOME_CONSTANT.equals( testString ) )
// do something
}In the above code, even if testString was null, a runtime exception will not be generated. However, if the equals() method was called on testString and it happened to be null, you'd be looking at an exception.
Here's how I would have written the code you supplied.
String zDescValue = (String) hshipTrackSummaryDocList.get( "Z_DESC" );
if ( zDescValue == null ) zDescValue = "";
if ( "".equals( zDescValue ) )
// do something useful
else
// do something else
}I've also come across similar situations. In order not to repeat the same code everywhere, I've wound up writing a couple of utility methods to assign "" to a string if it's null. Here are those methods.
public static String processStringValue( String inputString, String defaultValue )
return ( inputString == null ? defaultValue : inputString );
public static String processStringValue( String inputString )
return processStringValue( inputString, "" );
}Finally, you may want to be careful about the code fragments you post. From your post and profile, I can guess where you work. Your employer may or may not care if parts of their code start showing up on the Internet. It's better to create a general piece of code that approximates what you want to convey. However, it's better to be safe than sorry.
Hope this helps!
Cheers! -
Steve? Do I really need all this code if I don't use insertRow()?
protected void initializeBindingsForPage(DataActionContext ctx)
System.out.println("***** initializeBindingsForPage - Start ***** ");
HttpServletRequest request = ctx.getHttpServletRequest();
String strCallingEvent = request.getParameter("event");
if (strCallingEvent != null )
System.out.println("event=" + strCallingEvent );
if ( strCallingEvent.equalsIgnoreCase("MYCREATE"))
System.out.println("---retrieving defaults for empno, report_year");
// Find parent values to seed this row.
Number numEmpno = null;
String strReportYear = null;
BindingContext bctx = ctx.getBindingContext();
Row r = bctx.findBindingContainer("browseEmpReportsDueUIModel")
.findIteratorBinding("ViewEmpReportsDueView1Iterator")
.getCurrentRow();
numEmpno = (Number) r.getAttribute("Empno");
strReportYear = (String) r.getAttribute("ReportYear");
System.out.println("numEmpno=" + numEmpno );
System.out.println("strReportYear=" + strReportYear );
// look for empno/reportyear
DCBindingContainer bc = ctx.getBindingContainer();
DCIteratorBinding iter = bc.findIteratorBinding("EmpReportView1Iterator");
System.out.println("---looking for existing row with this empno, report_year");
try
String strKey = null;
NameValuePairs keyValues = new NameValuePairs();
keyValues.setAttribute("Empno", numEmpno );
keyValues.setAttribute("ReportYear", strReportYear);
Key k = iter.getRowSetIterator().createKey( keyValues );
strKey = k.toStringFormat(true);
// Find the row in the associated row iterator based on the Key
// object and if found set that as the current row.
iter.setCurrentRowWithKey( strKey );
// can we exit this method if we found it? yes!
return;
catch (RowNotFoundException rex )
System.out.println( rex.getMessage() );
// ignore - we'll create it.
RowSetIterator rsIter = iter.getRowSetIterator();
System.out.println("rsIter.isRangeAtTop()="+rsIter.isRangeAtTop());
System.out.println("rsIter.isRangeAtBottom()="+rsIter.isRangeAtBottom());
System.out.println("rsIter.getCurrentRowSlot()="+
slotName( rsIter.getCurrentRowSlot() ) );
Row newRow = rsIter.createRow();
System.out.println("rsIter.isRangeAtTop()="+rsIter.isRangeAtTop());
System.out.println("rsIter.isRangeAtBottom()="+rsIter.isRangeAtBottom());
System.out.println("rsIter.getCurrentRowSlot()="+
slotName( rsIter.getCurrentRowSlot() ) );
if ( newRow != null )
System.out.println("after Create action invoke, stting attributes");
newRow.setAttribute("Empno", numEmpno );
newRow.setAttribute("ReportYear", strReportYear);
newRow.setNewRowState(Row.STATUS_INITIALIZED);
// rsIter.setCurrentRow( newRow );
// this doesn't make it current
// Another navigation attempt - fails!
// iter.getViewObject().setCurrentRow( newRow );
// Moves the currency to the slot before the first row.
// did not appear to show 1st record on 1st pass! Can we not move
// to this row??
// rsIter.reset();
// NOTE: If this code is NOT run, then your data entry screen only
// ever displays the first row, though the multi-record grid at
// bottom shows ALL rows!
Row tmpRow = rsIter.first();
if (tmpRow != null)
EmpReportViewRow empRow = (EmpReportViewRow) tmpRow;
System.out.println( "rowFound, Empno=" + empRow.getEmpno()
+ ",Report_Year=" + empRow.getReportYear() );
while ( rsIter.hasNext() )
empRow = (EmpReportViewRow) rsIter.next();
System.out.println( "rowFound, Empno=" + empRow.getEmpno()
+ ",Report_Year=" + empRow.getReportYear() );
} // iterator other rows
} // found the row
// End of moving to row just added - why are we doing this??
Row thisRow = iter.getCurrentRow();
if ( thisRow != null )
System.out.println("thisRow[\"Empno\"]=" +
thisRow.getAttribute("Empno"));
System.out.println("thisRow[\"ReportYear\"]=" +
thisRow.getAttribute("ReportYear"));
else
System.out.println("getCurrentrow() after setting defaults not found");
} // newRow != null
else
System.out.println("getCurrentRow() did not return a row!");
} // MYCREATE CALLED THIS
System.out.println("***** initializeBindingsForPage - End ***** ");
} // initializeBindingsForPageI notice that Validifier turns the code into "Strict" HTML.
No it doesn't. It turns <embed> code (which was never sanctioned by the W3C) into VALID XHTML <object> code. Valid code passes W3C validation tests on either Strict or Transitional XHTML document types.
Shorter code is nice, but I like my W3C compliance. That's why I collapse code on scripts, forms, and embeds.
Huh? What? Collapse is a DW code view option only. It has no effect on published code.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
Urgent assistance needed on textfields/labels please!!
I have been trying for days to add labels and textFields to my applet and can only manage to display one.
My assignment instructions suggest I use makeTextField method and call the setEditable method from the makeTextField method to avoid repetition of code.
The following is my code...I must have this done in the next couple of days so if someone could please please give me some assistance it would be really appreciated....also, thoughts on my layout would be great as well...i cant seem to set up my buttons in the correct order.
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class Registry4b extends Applet implements ActionListener {
public void init() {
backgroundColor = new Color(200,255,255);
this.setLayout(new FlowLayout(FlowLayout.CENTER,4,1));
makeButtons();
row1 = makePanel(new FlowLayout(FlowLayout.LEFT,4,2),backgroundColor);
row1.add(clearB);
row1.add(studFindB);
row1.add(studForB);
row1.add(courB);
row2 = makePanel(new FlowLayout(FlowLayout.LEFT,4,2),backgroundColor);
row2.add(studBackB);
row2.add(courFindB);
row2.add(courForB);
row2.add(studB);
row3 = makePanel(new FlowLayout(FlowLayout.LEFT,4,2),backgroundColor);
row3.add(courBackB);
add(row1);
add(row2);
add(row3);
Panel p = new Panel(new BorderLayout());
Label studID = new Label("STUDENT ID");
TextField entry = new TextField(" ");
p.add(studID,BorderLayout.WEST);
p.add(entry,BorderLayout.CENTER);
Label firstTF = new Label("FIRST NAME");
makePanel(new BorderLayout(2,2),backgroundColor);
add("West",courBackB);
add("East",studB);
makePanel(new BorderLayout(2,2),backgroundColor);
add("North",p);
add("South",courForB);
makePanel(new BorderLayout(2,2),backgroundColor);
add("North",courFindB);
add("South",studBackB);
makePanel(new BorderLayout(2,2),backgroundColor);
add("West",p);
add("East",studForB);
setBackground(backgroundColor);
clearB.addActionListener(this);
courBackB.addActionListener(this);
studB.addActionListener(this);
courForB.addActionListener(this);
courFindB.addActionListener(this);
studBackB.addActionListener(this);
courB.addActionListener(this);
studForB.addActionListener(this);
studFindB.addActionListener(this);
private Label makeLabel(String label) {
Label label1 = new Label(label,Label.RIGHT);
label1.setFont(new Font("Courier",Font.BOLD,10));
return label1;
public void start() {
appletWidth = 8*4+row1.getSize().width;
appletHeight = 8*(2+courBackB.getSize().height);
public void paint(Graphics g) {
setSize(appletWidth,appletHeight);
validate();
public void actionPerformed(ActionEvent e) {
String s = (String)e.getActionCommand();
private Button makeButton(String label, Color color, Font font) {
Button b = new Button(label);
b.setBackground(color);
b.setFont(font);
return b;
private Panel makePanel(LayoutManager lm, Color c) {
Panel p = new Panel();
p.setLayout(lm);
p.setBackground(c);
return p;
private void makeButtons() {
Font f = new Font("Courier", Font.BOLD, 10);
Color grey = new Color(255,100,100);
clearB = makeButton("CLEAR",grey,f);
studB = makeButton(" STUDENTS ",grey,f);
studForB = makeButton("->",grey,f);
studFindB = makeButton("FIND",grey,f);
courFindB = makeButton("FIND",grey,f);
studBackB = makeButton("<-",grey,f);
courB = makeButton(" COURSES ",grey,f);
courBackB = makeButton("<-",grey,f);
courForB = makeButton("->",grey,f);
TextField addressTF = new TextField("ADDRESS", 10);
static final String initialString = " ";
String Filler = " ";
Panel row1, row2, row3, p1;
int appletWidth, appletHeight;
Button clearB, studForB, studFindB, courFindB,
studBackB,courB, courBackB, studB, courForB;
Color backgroundColor;
thanks in advance for anything someone can do for meI haven't tried your code, but since you use a layout manager, you shouldnt need to think about setting the size for the applet.
And I think when you call the method makePanel the last 4 times, you want to use the returned panel to add your components on. Right now you add everything directly to the panel and never use the panels you create.
And you also reuse some of your components more than once (like e.g. courBackB). You need to create a new button everytime, otherwise if you try to add the same button twice, the second one will not be displayed.
Try to add the components one by one and check it is displayed before you add the next one.
If you want to check what components and their sizes etc, you have on your applet, here is a little trick. Get the focus on your applet and press ctrl+shift+F1. If you run the applet in a browser, you will get something in the java console that displays all your GUI components and a description of them. So
It might help you.
Also take a look of the Java Tutorial for the AWT. You can download it from
http://java.sun.com/docs/books/tutorial/information/download.html
called tut-OLDui.zip. -
Hello,
This is the first program that I have attempted to write alone....and I am stuck. I am trying to acquire data from a scope. I want the vi to only load the scope setup the first time the code is executed. Once the setup has been loaded I just want the vi to reinitialize the scope in order to acquire more data. I have tried first call, case structures, ...everything I can think of, but when I continuously run the vi, it still loops and reloads the setup each time. I have attached a picture of the vi code and outlined the area of code in question. The outlined case structure is programmed to initialize the scope to open communications, then clear any existing data, then recall a specific scope setup on true. On false, I only want this setting of code to initialize communications with the scope again without recalling the setup. Can a professional please explain how I am supposed to accomplish this. Thank you
Solved!
Go to Solution.
Attachments:
Code.jpg 69 KBIf you use CONTINUOUSLY RUN to keep something running, you are in effect pushing the RUN button every time it stops, so the FIRST RUN function will return TRUE every time.
There are ways to do exactly what you ask, but you're better off looking at the heart of your issue:
You need a loop.
Put a WHILE loop around the part you want to do repeatedly.
Create a STOP button to stop the loop.
Do your once-only INIT stuff outside the loop, and make sure the INIT part passes something into the WHILE loop
(to make sure the loop doesn't start until after INIT).
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks -
Urgent Assistance needed on this
Hi, I am fairly new to Java and this assignment is way over my knowledge, if anyone able to assist me on the whole coding, that would be great. Thanks all.
I am thinking on using array and the file heading on hardware.dat can be omitted.
Task-
Imagine that you are an owner of a hardware store and need to keep an inventory that can tell you what different kind of tools you have how many of each you have on hand and cost of each one.
Now do the following:
(1) Write a program (Tool.java) that,
(1.1) Initializes (and creates) a file ?hardware.dat?
(1.2) lets you input that data concerning each tool, i.e. the program must ask the user for input and each of the user input is written back in the file.
The file must have the following format:
Record# Tool Name Qty Cost per item (A$)
1 Electric Sander 18 35.99
2 Hammer 128 10.00
3 Jigsaw 16 14.25
4 Lawn mower 10 79.50
5 Power saw 8 89.99
6 Screwdriver 236 4.99
7 Sledgehammer 32 19.75
8 Wrench 65 6.48
(1.3) Exception handling that must be taken into account-
(1.3.1) User must not input incorrect data
(1.3.2) Cost of the item must be a number
(2) Write another program (ListToolDetails.java) that,
(2.1) lets you list all the tools, i.e. it will read the data from ?hardware.dat? in a proper manner (you can choose the display format), File name should not be hard coded.
(2.2) lets you delete a record for a tool, as an example- you can delete all the details pertaining to the tool ? Wrench. Once you delete the information, records must be updated in the ?dat? file.
(2.3) List the total price(rounded to two decimal places) of each tool, as an example, the total price of all the Hammers is A$128 * 10 = A$1280.00
(2.4) Exception handling that must be taken into account-
(2.3.1) In case user inputs an incorrect file name
(2.3.2) In case user inputs incorrect Tool name (when the user wants to delete something)
Bonus Task
This task deals with the inclusion of Javadoc comments and generation of documentation pages.
Task-
Your task is to add meaningful javadoc comments in all the programs and generate HTML documentation pages.Hi, I am fairly new to Java and this assignment is
way over my knowledge, if anyone able to assist me on
the whole coding, that would be great. Thanks all.
I am thinking on using array and the file heading on
hardware.dat can be omitted.
Task-
Imagine that you are an owner of a hardware store and
need to keep an inventory that can tell you what
different kind of tools you have how many of each you
have on hand and cost of each one.
Now do the following:
(1) Write a program (Tool.java) that,
(1.1) Initializes (and creates) a file
?hardware.dat?
(1.2) lets you input that data concerning each tool,
i.e. the program must ask the user for input and each
of the user input is written back in the file.
The file must have the following format:
Record# Tool Name Qty Cost per item (A$)
1 Electric Sander 18 35.99
2 Hammer 128 10.00
3 Jigsaw 16 14.25
4 Lawn mower 10 79.50
5 Power saw 8 89.99
6 Screwdriver 236 4.99
7 Sledgehammer 32 19.75
8 Wrench 65 6.48
(1.3) Exception handling that must be taken into
account-
(1.3.1) User must not input incorrect data
(1.3.2) Cost of the item must be a number
(2) Write another program (ListToolDetails.java)
that,
(2.1) lets you list all the tools, i.e. it will read
the data from ?hardware.dat? in a proper manner (you
can choose the display format), File name should not
be hard coded.
(2.2) lets you delete a record for a tool, as an
example- you can delete all the details pertaining to
the tool ? Wrench. Once you delete the information,
records must be updated in the ?dat? file.
(2.3) List the total price(rounded to two decimal
places) of each tool, as an example, the total price
of all the Hammers is A$128 * 10 = A$1280.00
(2.4) Exception handling that must be taken into
account-
(2.3.1) In case user inputs an incorrect file name
(2.3.2) In case user inputs incorrect Tool name (when
the user wants to delete something)
Bonus Task
This task deals with the inclusion of Javadoc
comments and generation of documentation pages.
Task-
Your task is to add meaningful javadoc comments in
all the programs and generate HTML documentation
pages.First of all , If its your assignment you are ment to do it your self !!
if u have a problem understanding stuff ask your tutor or prof.
they are paid to teach u this stuff....
second : break the problem in to small task as suggested before, it will help u understand the stuff better
Last thing : No one here is gona do your home work for u
so better start doing some research and if u have an implementation or a logic problem then post them here, sure people will help.
now from what i read i think u need to start looking up on
1) get data from the user : u need some thing like bufferedreader
2) validate the input : check with the upper and lower bounds
3) File handing : research on how to write to a file there are a milion pages there on the web teaching you this stuff -
Help needed with this tutorial please
Hello in this InsertUpdateDelete tutorial at:
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
or
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
and in this paragraph:
Changing the Column Components
and this statement
In the Visual Designer, select the top Drop Down List component in the Table.
"It's pretty confusing because there isn't a Drop Down List component in the Table as far as i can tell. There is a Drop Down List on the canvas up above this data table, but that has already been bound in a previous process, here is that previous proces:"
Configuring the Drop Down List
Select the Drop Down List in the Visual Designer and, in the Properties window, change its General > id property to personDD.
Right-click the personDD Drop Down List in the Visual Designer and choose Bind to Data from the pop-up menu. The Bind to Data dialog box appears.........
Can anyone tell me where i can get help with this tutorial or where i can download the finished program so i can sync up with what is actually being referenced in the questional statement that i mentioned above please?
Thanks very much!
BobKIn Step 5 of "Changing the Column Components" you change the Trip Type column to a drop-down list.
5. Select TRIP.TRIPTYPEID from the Selected list and make the following changes:
* Change the Header text field from TRIPTYPEID to Trip Type.
* Using the drop-down list, change the Component Type from Static Text to Drop Down List.
6. Click OK to enforce your changes and dismiss the window. If the table columns are too wide after performing the above steps, you can resize them by selecting the first component in each column and dragging its selection handles.
7. In the Visual Designer, select the top Drop Down List component in the Table. Right-click and choose Bind to Data from the pop-up menu. The Bind to Data dialog box opens. -
Macbook Pro Melted Its Own Casing - Expert eyes needed on this photo please of my macbook pro
This is a 2008 15" Macbook Pro.
At the genius bar I pointed out that the computer was so hot I could barely hold it, so hot the computer had warped it's own plastic casing where it connects to the power source.
So the genius guy took it in the back, opened it up, diagnosed a fried logic board and said "For $310 we'll fix up anything in the computer, you'll get it back good as new." In 2010 the logic board also fried and was replaced, and the heat cooling system was then replaced - looks like the same issue all over again.
So I took it home to get the data off the hard drive, but when I brought it back a few days ago, the new 'genius' made a different diagnosis.
Without barely looking at it, without taking it in the back, and without listening to or believing anything I told him, the Genius Bar are calling this impact damage - overriding the previous genius's assessment.
How can the perfectly symmetrical ripple wave in the plastic which goes top to bottom through a half inch of plastic be created by impact damage? And that the plastic piece below is not warped would mean I would have had to have removed the bottom piece of the computer, dropped it, then put it back on, in order for it to not be warped like its top half.
Are there any expert eyes out there who have an opinion on this keeping in mind the symptoms?
Additionally when the computer was its hottest, the trackpad would not click. The plastic must have expanded from the heat. So it would click, but only if I pressed really really hard. Doing this one day the plastic on the trackpad actually shattered from clicking it. But the shattering must have removed the surface pressure from the expanded plastic and therefore the trackpad became fully functional again in its shattered state and that's how I've been using it for quite some time.
I really appreciate any expert support from the community here if you disagree with the 2nd geniuses because I am complaining through official channels. I do not want to pay extra for damage the computer did to itself. Especially when this is the 2nd time the logic board fried on this computer.
I am someone who has owned apple's first everything since the 80's, and have worked on two Apple commercials myself. I'm currently typing this post from a PC... Does Apple want to satisfy its customers anymore or what?
I never did get a feeback solicitation emailed about this appointment either, I wonder why.
<Edited by Host>Each time I look at this post - the moderator has edited it again into something different than I said. Moderator, I'd prefer to remove this entirely if you are going to change the meaning of it. How do we do this? The above posts at 9:25a and 9:57a are not my language at all. And the moderator looks to have removed my ability to edit my post.
An update to the discussion (which I will repost separately when the moderator removes these ones which s/he's altered) - apparently this happened to other people as well - enough to bring a class action suit on apple forcing them to repair the issue:
https://discussions.apple.com/thread/2536493
http://gigaom.com/apple/is-apple-blind-to-nvidia-related-macbook-pro-failures/
https://discussions.apple.com/thread/2675881?start=60&tstart=0
The Beverly Center apple store handled this 1000% better than the 3rd Street Promenade Store did - just got back the Macbook Pro, entirely repaired for $310, just like the 1st genius as 3rd Street Promenade told me would/should happen, overruling the 2nd set of geniuses Adrian, Phillipe and Matt.
I tried the 866 customer support # at apple to tell them about my unpleasant experience with 3rd Street Apple, and was routed around in circles being on hold for 12 minutes at a time - got nowhere. They told me I could give feedback at apple.com/feeback - but this site offers nowhere to plug in unpleasant experiences with the genius bar - only allow one to complain about equipment. So despite all the phone calls I've made, my experience has gone unheard by apple.
Though I've twice paid $300 to have the fried logic board replaced on this computer, I am asking apple to reverse the charges due to the class action and known issue with the NVIDIA graphics card on these models.
Not only did they replace the casing (which was melted), they replaced the battery which was leaking and had expanded, replaced the fried logic board, and the fried CD player. Additonally, when using this computer before, I periodically felt little shocks to my wrists where my skin contacted the edge of the casing. And the computer was so hot I couldn't hold it. If these aren't heat/power issues, I don't know what are. -
& Include MZFBPS_TRREQTOP Module poo
PROGRAM SAPMZFBPS_TRREQ .
tables : ZFBPS_TRPTR_REQ,
ZFBPS_CONT_HD,
ZFBPS_CONT_DT.
data: OK_CODE like sy-ucomm,
save_ok(4).
data : it_gate like standard table of ZFBPS_TRPTR_REQ,
wa_gate like line of it_gate.
TYPES: BEGIN OF values,
TRANSPORTER_CODE TYPE ZFBPS_CONT_HD-TRANSPORTER_CODE,
TRUCK_CODE TYPE ZFBPS_CONT_DT-TRUCK_CODE,
DESTINATION TYPE ZFBPS_CONT_DT-DESTINATION,
END OF values.
DATA: TRANS(5) TYPE c,
TRUCK(15) TYPE c.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values,
values_tab TYPE TABLE OF values.
*& Module INIT OUTPUT
text
MODULE INIT OUTPUT.
progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'TRANS'.
APPEND field_value TO dynpro_values.
ENDMODULE. " INIT OUTPUT
*& Module VALUE_TRANS INPUT
text
MODULE VALUE_TRANS INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'ZFBPS_CONT_HD'
fieldname = 'TRANSPORTER_CODE'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TRANS'.
ENDMODULE. " VALUE_TRANS INPUT
*& Module VALUE_TRUCK INPUT
text
MODULE VALUE_TRUCK INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT ATRANSPORTER_CODE BTRUCK_CODE b~DESTINATION
FROM ( ZFBPS_CONT_DT AS B INNER JOIN ZFBPS_CONT_HD AS A
ON ACONTRACT_NUM EQ BCONTRACT_NUM )
INTO CORRESPONDING FIELDS OF TABLE values_tab
WHERE A~TRANSPORTER_CODE = field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TRUCK_CODE'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TRUCK'
value_org = 'S'
TABLES
value_tab = values_tab.
ENDMODULE. " VALUE_TRUCK INPUT
In values_tab I have three fields and I wish to return all the three fields,but at present I am able to return only one field (TRUCK). How to return other fields.
Please suggest a solution.
Regards,
Deepak.Do not pass the dynprofield parameter and check.
Regards,
Ravi -
what this code does ?
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");i am studying this code....
//Verify the hostname, check all trusted cetifcates and install them in the machine
com.sun.net.ssl.HostnameVerifier ver = new com.sun.net.ssl.HostnameVerifier(){
public boolean verify(String urlHostname,String certHostname)
try
{ return true;
} catch(Exception x){ return true; }
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[]{
new javax.net.ssl.X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
// Install the all-trusting trust manager
try {
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
sc=null;
} catch (Exception e) {
e.printStackTrace();
//Setting the defaultHost name verfier set by the user for communication
HttpsURLConnection.setDefaultHostnameVerifier(ver);/**/please note the bold colored code from the above i.e
HttpsURLConnection.setDefaultHostnameVerifier(ver);
so, ver instance has been presented to the setDefaultHostnameVerifier . fine....but who is calling the methods verify() which is described in the implemented Annoynymous interface HostnameVerifier .
who is calling that overridden method verify() ?
similarly, who is calling getAcceptedIssuers() method?
I DONT see any invocation of these overridden methods .
are these methods are FRAUD and BUGGY...and are not needed in this code....are they redundant ?
OR are these methods are invoked by the HttpsURLConnection internally somehow....
confused about the functionng of this code.
thanks for the time -
Hello I buyed my Sony experia z1 from Ireland Vodafone but now I live in Uk and changed the Sim card but it want me to enter nac.The problem is I asked Vodafone to provide me this code and they want me to pay for that by topping up my card with 77 euro to make 127 euro calls for 6 months to be qualified for the code can Sony give me this code please I need him.
Buying from an operator it will be locked to their network - Pay a little more for Generic and or unlocked devices and you can use it on any network
1st you should check if your phone can be unlocked or is it permanently locked
Dial *#*#7378423#*#* then go to Service info then Sim lock and post results exactly as they are
For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled. Richard P. Feynman -
Hi ..
my requirement is the program should prompt for 3 parameters (all check marks) with the follwoing text; all check marks enabled by default
- Variables
- Key Figures
- Structures
So when users select variables then do this part in main program
test_for = 'STR'.
perform dowork using test_for.
for key figures
test_for = 'CKF'.
perform dowork using test_for.
test_for = 'SEL'.
perform dowork using test_for.
for variables
test_for = 'VAR'.
perform dowork using test_for.
please give the code how to write that one.
thanks in advance
MadhaviHi Maik,
am using this quode for one tool .this tool is used for copy queries from one system another instead of transporting.its easy method.so i want to do some modifications for this code.please elaborate ur answer .will assign points.
Cheers,
Madhavi -
I'll never cope with the pivot. May you check this code please guys...:
select * from archivebilled
pivot ( sum([month charge]) for [element code] in ('august','september','october','december'))
Incorrect syntax near augustLeave out the As clause. Put the as alias in the Select statement.
select
[august] as Ageste
, [september] as Septe
,[october] as Ottobered
,[november] as Nove
.[december] as Dicombero
, * from archivebilled
pivot ( sum([element charge]) for [element code] in ([august]
,[september]
,[october]
,[november]
,[december] ) as ele
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com -
I am trying to redeem my iTunes account with a gift card and it keeps coming up with "the Gift certificate or prepaid card code you entered has not been properly activated. Please contact iTunes customer support for assistance" what does this mean?
It all comes down to contact iTunes customer support for assistance.
iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html > Get iTunes support via Express Lane > iTunes > iTunes Store
Maybe you are looking for
-
Share folder with some family members
Hello, I have one Imac with several users (wife and kids). I like to share some data with my wife without access by the kids. That means I want to have a folder, where both of us can save files and have read/write access to the files. It seems diffic
-
How do I add family accounts to the my icloud account?
I have three family accounts that have different emails and passwords. Can I use I cloud to share data and purchases?
-
CS2 and Upgrading Photoshop 8 only
I'm currently running CS2 on Windows XP Home Edition and I'm wondering if it is possible to upgrade just Photoshop 8 as it's the only part of CS2 that I use regularly. Will it effect the other parts of CS2 if I can do this?
-
Word wrap not working in office 365
After the latest version upgrade to Firefox 28, word wrap functionality is not working correctly in office 365 owa. Email tries to compose all on one line. Have tried updating Java and resetting Firefox back to default settings.
-
The plug-in for the selected item is not installed on your system
Hello, When I want to build an application there is a "!" mark before the application and for the Installer, in the Project Explorer under Build Specification. When I ask for "explain warning" I got the message "The plug-in for the selected item is