No frames, no grids
Friends,
I hear the message loud and clear: Don't use frames, don't use grids. OK. So, how do I control the position and size of a component or table on a page without a grid?
Thanks!
Hinrich
There is no law saying you cant use frames/grids
But you have to be awear of the cons and pros when using those
Cohog wrote:
Friends,
I hear the message loud and clear: Don't use frames, don't use grids. OK. So, how do I control the position and size of a component or table on a page without a grid?
Thanks!
Hinrich
CSS is the answer
How to do that dependes on what, how and where you want to position things
Eksample:
you want to make a page that are 520px wide and is center in the browser without using frames(or table) ? ... easy ... look at this simple tutorial on how to center a page
http://www.mindpalette.com/tutorials/center_layers/index.php
Similar Messages
-
Outer table frame without grid lines
Howdy,
I have a form that is printing a variable size table that can span more than one page. I am attempting to create an outer frame around the table without grid lines in the middle.
There is a framed pattern, the one in the upper left hand corner of the patterns, that appears to fit my scenario. However, when I use this pattern, the outer frame appears, but there are also grid lines.
Is it possible to create an outerfram around a table without grid lines between the cells?Hello Ernest,
Goto Table Painter Settings, there you have tabs like Grid, Main Grid and so on...
By default, it would have selected the Display check box in Grid tab. Remove that check and goto Main Grid tab, and check the Display check box.
I guess your problem is solved.
Regards,
Prem -
Please help!
This depends on whether you need to open previously created AppleWorks documents. The only programs which can do this are EazyDraw (right) and Intaglio (though when I tested the demo it wouldn't open complex drawings such as the one below). If you are dealing with complex technical drawings EazyDraw is probably the best choice: it's about the same cost as the whole of iWork (when downloaded, and rather more expensive on a CD), but cheaper than some other vector based programs, and seems to handle the whole process well - though it does operate somewhat differently from AppleWorks. There is a much cheaper version available on the Mac App Store, but note that it does not open AppleWorks Draw Documents: neither does the latest version from their website (4.1.x) - for this you need 4.0.x 'Retro', also available from the website.
If you are only concerned with making new documents, then you can do a certain amount in Pages: but a better bet might be Swift Publisher 2, which is a layout program with a library of clip-art. I use it in preference to Pages for layout, though not for word processing - it isn't really designed for that.
EasyDraw is also a powerful drawing program: if you're not concerned with opening old AppleWorks documents the version from the Mac App Store is the one to go for. -
How do I make this code generate a new pro when the "NEXT" button is pushed
How do I make this code generate a new set of problem when the "NEXT" Button is pushed
* To change this template, choose Tools | Templates
* and open the template in the editor.
/* Figure out how to create a new set of problms
* Type a list of specifications, include a list of test cases
* DONE :]
package javaapplication1;
import java.awt.GridLayout;
import java.awt.Window;
import javax.swing.*;
import java.awt.event.*;
* @author Baba Akinlolu -
class Grid extends JFrame{
int done = 0;
final int score = 0;
final int total = 0;
//Create Panels
JPanel p2 = new JPanel();
JPanel p3 = new JPanel();
final JPanel p1 = new JPanel();
//Create Radio buttons & group them
ButtonGroup group = new ButtonGroup();
final JRadioButton ADD = new JRadioButton("Addition");
final JRadioButton SUB = new JRadioButton("Subtraction");
final JRadioButton MUL = new JRadioButton("Multiplication");
final JRadioButton DIV = new JRadioButton("Division");
//Create buttons
JButton NEXT = new JButton("NEXT");
JButton END = new JButton("End");
//Create Labels
JLabel l1 = new JLabel("First num");
JLabel l2 = new JLabel("Second num");
JLabel l3 = new JLabel("Answer:");
JLabel l4 = new JLabel("Score:");
final JLabel l5 = new JLabel("");
JLabel l6 = new JLabel("/");
final JLabel l7 = new JLabel("");
//Create Textfields
final JTextField number = new JTextField(Generator1());
final JTextField number2 = new JTextField(Generator1());
final JTextField answer = new JTextField(5);
Grid(){
setLayout(new GridLayout(4, 4, 2 , 2));
p2.add(ADD);
p2.add(SUB);
group.add(ADD);
group.add(SUB);
group.add(MUL);
group.add(DIV);
p2.add(ADD);
p2.add(SUB);
p2.add(DIV);
p2.add(MUL);
//Add to panels
p1.add(l1);
p1.add(number);
p1.add(l2);
p1.add(number2);
p1.add(l3);
p1.add(answer);
p1.add(l4);
p1.add(l5);
p1.add(l6);
p1.add(l7);
p3.add(NEXT);
p3.add(END);
//Add panels
add(p2);
add(p1);
add(p3);
//Create Listners
Listeners();
void Listeners(){
NEXT.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int answer1 = 0;
//Grab the numbers entered
int numm1 = Integer.parseInt(number.getText());
int numm2 = Integer.parseInt(number2.getText());
int nummsanswer = Integer.parseInt(answer.getText());
//Set the score and total into new variabls
int nummscore = score;
int nummtotal = total;
//Check if the add radio button is selected if so add
if (ADD.isSelected() == true){
answer1 = numm1 + numm2;
//otherwise check if the subtract button is selected if so subtract
else if (SUB.isSelected() == true){
answer1 = numm1 - numm2;
//check if the multiplication button is selected if so multiply
else if (MUL.isSelected() == true){
answer1 = numm1 * numm2;
//check if the division button is selected if so divide
else if (DIV.isSelected() == true){
answer1 = numm1 / numm2;
//If the answer user entered is the same with th true answer
if (nummsanswer == answer1){
//add to the total and score
nummtotal += 1;
nummscore += 1;
//Convert the input back to String
String newscore = String.valueOf(nummscore);
String newtotal = String.valueOf(nummtotal);
//Set the text
l5.setText(newscore);
l7.setText(newtotal);
//Otherwise just increase the total counter
else {
nummtotal += 1;
String newtotal = String.valueOf(nummtotal);
l7.setText(newtotal);
//Create End listener
END.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// get the root window and call dispose on it
Window win = SwingUtilities.getWindowAncestor(p1);
win.dispose();
//new Grid();
String Generator1(){
int randomnum;
randomnum = (1 + (int)(Math.random() * 100));
String randomnumm = String.valueOf(randomnum);
return randomnumm;
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
JFrame frame = new Grid();
frame.setTitle("Flashcard Testing");
frame.setSize(500, 200);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}Edited by: SirSaula on Dec 7, 2009 10:17 AMNot only are you continuing to post in the wrong forum but now you are multiposting: [http://forums.sun.com/thread.jspa?threadID=5418935]
If people haven't answered you other posting its probably because we don't understand the question. Quit cluttering the forum by asking the same question over and over and then next time you have a new question post it in the proper forum. Your first posting was moved becuase you didn't post it properly. -
Combine two reports in query designer using key figure with sap exit
Hi experts,
i want to combine two reports in query designer using key figure with sap exit
in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
to calculate due and not due in two columns
in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
now i have requirement like this
not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
or
not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
thank youHi Dirk,
you perhaps know my requirement,
for the management to make used in one report,
we have in reporting finacials Ehp3.
Vendor Due Date Analysis - which show due, not due
Vendor Overdue Analysis - show only due and analysis in time grid frame
i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
krish... -
Help needed in getting applet working
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class murali1 extends JApplet{
private Container contain;
private GridBagLayout grid;
private GridBagConstraints c;
* Create the GUI and show it.
public murali1() {
//super("Assignment 1");
//Create and set up the window.
JFrame frame = new JFrame("Assignment 1");
//Menu
JMenuBar bar = new JMenuBar();
JMenu file = new JMenu("File");
bar.add(file);
JMenuItem open = new JMenuItem("Open");
file.add(open);
open.addActionListener(new ActionListener(){
public void actionPerformed (ActionEvent e)
JMenuItem save = new JMenuItem("Save Random");
file.add(save);
save.addActionListener(new ActionListener(){
public void actionPerformed (ActionEvent e)
JMenuItem exit1 = new JMenuItem("Exit");
file.add(exit1);
exit1.addActionListener(new ActionListener(){
public void actionPerformed (ActionEvent e)
System.exit(0);
//Create 4 panels
JPanel panel1,panel2,panel3,panel4;
/*Adding components to Panel 1
Panel 1 contains one Label and a ComboBox
Panel 1 is a GridLayout
panel1=new JPanel();
String method[] = {"Random","Ascending","Descending"};
JComboBox combo = new JComboBox(method);//Combo Box
combo.setMaximumRowCount(3);
combo.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent comboevent)
JLabel combolabel;
combolabel = new JLabel("Choose Prioritization Heuristic");
//panel1.setLayout( new GridLayout (2,1));
panel1.add(combolabel);
panel1.add(combo);
/*Adding components to panel 2
Panel 2 contains one label and one text area
Panel 2 is a GridLayout
panel2 = new JPanel();
JLabel textlabel = new JLabel("Evaluator Results");
JTextArea evalarea = new JTextArea();
panel2.add(textlabel);
//panel1.setLayout( new GridLayout (2,1));
panel2.add(evalarea);
/*Adding components to panel 3
Panel 3 contains 5 labels,3 textfields, 1 button
Panel 3 is a GridLayout
panel3 = new JPanel();
JLabel label1,label2,label3,label4,label5;
label1 = new JLabel("Use the Fields only for Random Heuristic");
label2 = new JLabel("Enter Maximum # of Tries");
label3 = new JLabel("Enter # of Tests in TS");
label4 = new JLabel("Enter ID# of Tests in TS(d) (Separated by Comma)");
label5 = new JLabel("Please Press SUBMIT");
JTextField tf1,tf2,tf3;
tf1 = new JTextField();
tf2 = new JTextField();
tf3 = new JTextField();
JButton submit = new JButton("Submit");
//panel1.setLayout( new GridLayout (9,1));
panel3.add(label1);
panel3.add(label2);
panel3.add(tf1);
panel3.add(label3);
panel3.add(tf2);
panel3.add(label4);
panel3.add(tf3);
panel3.add(label5);
panel3.add(submit);
/*Adding components to panel 4
Panel 4 contains 4 labels,1 textfields, 3 button
Panel 4 is a GridLayout
panel4 = new JPanel();
JLabel label6,label7,label8,label9;
label6 = new JLabel("Press RUN to start evaluation");
label7 = new JLabel("Press Exit to Terminate Program");
label8 = new JLabel("MLP(d) and RP(d) are:");
label9 = new JLabel("Press CLEAR to start new evaluation");
JButton run = new JButton("Run");
JButton exit = new JButton("Exit");
JButton clear = new JButton("Clear");
JTextArea area1 = new JTextArea();
panel4.add(label6);
panel4.add(run);
panel4.add(label7);
panel4.add(exit);
panel4.add(label8);
panel4.add(area1);
panel4.add(label9);
panel4.add(clear);
/*panel1.setVisible(true);
panel2.setVisible(true);
panel3.setVisible(true);
panel4.setVisible(true);*/
/* set Grid Bag Layout
Add all the panels to the GridBag Layout
contain = frame.getContentPane();
grid = new GridBagLayout();
contain.setLayout(new GridBagLayout());
c = new GridBagConstraints();
addComponent(panel1,0,0);
addComponent(panel2,0,4);
addComponent(panel3,4,0);
addComponent(panel4,4,6);
//setSize(1200,100);
this.setVisible(true);
/*Method to Add Components*/
private void addComponent(Component co,int row,int column)
c.gridx = column;
c.gridy = row;
grid.setConstraints(co,c);
contain.add(co);
/*Set up the content pane.
addComponentsToPane(frame.getContentPane());*/
//Display the window.
//frame.pack();
//frame.setVisible(true);
public static void main(String[] args) {
murali1 g = new murali1();
//g.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
The Compliation is totally fine,applet loads, but the gui components are not diaplyed.Any suggestions.
Thank you.That's not really an applet. Or it's a half-done one. It looks like you just took a standalone app (with its own frame and everything), added "extends JApplet", commented out a few things that absolutely shouldn't work, and otherwise changed almost nothing.
The browser won't invoke the applet's main() method. I guess that's not a problem, but are you aware that it's not being invoked?
An applet is a kind of panel. You shouldn't be creating frames. You should put all the GUI elments in the panel...which it appears you did, but can you actually get rid of the irrelevant code? Furthermore, when you post code on these forums, you should wrap it in [code][/code] tags; it makes it much easier to read.
An applet shouldn't call System.exit(). You'll probably get a security exception if you try running that.
That addComponent method looks suspicious to me. You're changing the columns and row of the same object over and over again. I'm not a GUI expert, so maybe I'm wrong, but that seems really wrong.
You shouldn't need to call this.setVisible(true) for an applet.
I'd suggest cleaning your code up, and maybe moving some of that stuff out of the constructor anyway. In an applet it might be better placed in init().
Message was edited by:
paulcw -
Problem in printing to LPT1 through applet?
Hello everyone,
I am having problem in printing through Applet in LPT1 of remote client machine using "gridDoubleClicked" method of customized "GridPanel" which is third party component. The class structure is given below:
public class GridPanel extends Panel implements GridPanelInterface, AdjustmentListener, KeyListener, FocusListener, Serializable
}I am using above class to populate data in table and perform "double click" action. I am using JDK 1.5 and a self signed jar to access from remote machines through applet.The code, I am using is given below:
public class testApplet extends Applet {
printToLPT1 lpanel =new printToLPT1();
public void init() {
this.setLayout(new BorderLayout());
this.add(lpanel, BorderLayout.CENTER);
this.setSize(380, 250);
public class printToLPT1 extends Frame{
GridPanel grid;
public printToLPT1() throws Exception {
grid.addGridListener(new GridAdapter() {
public void gridDoubleClicked(GridEvent ge) {
testPrint();
public static void testPrint() throws Exception {
try {
BufferedOutputStream pos = new BufferedOutputStream(new FileOutputStream("LPT1"));
String str = "\n\n\n\n\n\n\n\n\n\n\n";
pos.write(str.getBytes());
pos.flush();
pos.close();
} catch (Exception fnfe) {
throw new Exception("PRINTER SETUP IS NOT PROPER");
}For applet, I have used following script in login.html:
<APPLET
height="200px"
archive="testprinter.jar,jbcl.jar,grid.jar,plugin.jar"
width="390px"
align="top"
code="test.testApplet.class"
name="Testing"
ALT="<P>This applet requires Java to be enabled! Check the browser options or see your SysAdmin." MAYSCRIPT>
<P>This page requires Java! Get it free from <A HREF='http://www.java.com/'>www.java.com</A>.</P>
</APPLET>
------------------- If signed jar file of application is run using command line in client machine then "double clicked" of GridPanel method works fine and send signal to printer at LPT1 port but when same application is called using applet and accessed from remote machine with printer in LPT1 port, in that time also "double clicked" of GridPanel method works fine but printer could not be found and Exception is thrown java.lang.Exception:"PRINTER SETUP IS NOT PROPER" . Why is this happening? Can anyone suggest me the solution for this problem?
Thanks in advance.
-Ritesh
Edited by: ritesh163 on Apr 15, 2010 2:56 PMThe SSCCE for this problem is given below:
//Applet class
package test;
import java.awt.BorderLayout;
import javax.swing.JApplet;
public class testApplet extends JApplet {
testPrint lpanel =new testPrint();
public void init() {
this.setLayout(new BorderLayout());
this.add(lpanel, BorderLayout.CENTER);
this.setSize(380, 250);
// Printing class...
package test;
import com.borland.jbcl.layout.XYConstraints;
import java.awt.Color;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import wdn.grid.GridAdapter;
import wdn.grid.GridData;
import wdn.grid.GridEvent;
import wdn.grid.GridPanel;
public class testPrint extends javax.swing.JFrame {
// Variables declaration - do not modify
private javax.swing.JButton btnPrint;
private javax.swing.JPanel jPanel1;
// End of variables declaration
GridPanel grid;
GridData gdata;
String[] gridCols = {
"Receipt No", "Name"};
public testPrint() {
grid = new GridPanel(0, 8);
gdata = new GridData(0, 8);
grid.setRowHeaderWidth(0);
grid.setGridData(gdata);
grid.setMultipleSelection(false);
grid.setColWidths("100,60");
grid.setColHeaders(gridCols);
setGridProperties(grid);
grid.setColSelection(false);
this.setVisible(true);
grid.addGridListener(new GridAdapter() {
public void gridDoubleClicked(GridEvent ge) {
//This event works fine...
System.out.println("Press Re-Print button...");
try{
stringToPrinter("testing by grid \n\n\n\n\n\n\n\n\n\n\n\n\n");
}catch(Exception ex){
ex.printStackTrace();
public void gridCellsClicked(GridEvent ge) {
btnPrint.setEnabled(true);
initComponents();
jPanel1.add(grid, new XYConstraints(52, 60, 100, 150));
grid.deleteRows(1, grid.getNumRows());
grid.insertRow(1);
grid.setCellText(1, 1, "12134", false);
grid.setCellText(2, 1, "test" + "", false);
grid.repaintGrid();
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
btnPrint = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
btnPrint.setText("Print");
btnPrint.setToolTipText("to Print");
btnPrint.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPrintActionPerformed(evt);
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(36, 36, 36)
.add(btnPrint)
.addContainerGap(287, Short.MAX_VALUE))
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(198, Short.MAX_VALUE)
.add(btnPrint)
.add(57, 57, 57))
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
pack();
}// </editor-fold>
private void btnPrintActionPerformed(java.awt.event.ActionEvent evt) {
try{
stringToPrinter("testing \n\n\n\n\n\n\n\n\n\n\n\n\n");
}catch(Exception ex){
ex.printStackTrace();
public static void setGridProperties(GridPanel grid) {
grid.setRowHeaderWidth(0);
grid.setAutoResizeColumns(true);
grid.setRowNumbers(true);
grid.setCellSelection(false);
grid.setRowSelection(true);
grid.setHighlightColor(Color.blue);
grid.setHighlightTextColor(Color.white);
grid.setAutoResizeRows(true);
grid.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
public void keyPressed(KeyEvent e) {
if (e.getKeyChar() == KeyEvent.VK_SPACE) {
public void keyReleased(KeyEvent e) {
public static void stringToPrinter(String str) throws Exception {
try {
System.out.println("inside stringToPrinter...");
BufferedOutputStream pos = new BufferedOutputStream(new FileOutputStream("LPT1"));
System.out.println("inside stringToPrinter...1-pos::"+pos);
pos.write(str.getBytes());
pos.flush();
pos.close();
} catch (Exception fnfe) {
throw new Exception("PRINTER SETUP IS NOT PROPER");
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new testPrint().setVisible(true);
} -
How do I make this program generate a new problem once the button is hit
Here is the code... appreciate any help given
How do I make this program generate a new set of problem when the "NEXT" button is clicked and continue until the END button is hit
package javaapplication3;
import java.awt.GridLayout;
import java.awt.Window;
import javax.swing.*;
import java.awt.event.*;
* @author Sylvester Saulabiu
class Grid extends JFrame{
final int score = 0;
final int total = 0;
Grid(){
//Set Layout of Flashcard
setLayout(new GridLayout(4, 4, 2 , 2));
//Create Panels
JPanel p2 = new JPanel();
JPanel p3 = new JPanel();
final JPanel p1 = new JPanel();
//Create Radio buttons & group them
ButtonGroup group = new ButtonGroup();
final JRadioButton ADD = new JRadioButton("Addition");
final JRadioButton SUB = new JRadioButton("Subtraction");
final JRadioButton MUL = new JRadioButton("Multiplication");
final JRadioButton DIV = new JRadioButton("Division");
p2.add(ADD);
p2.add(SUB);
group.add(ADD);
group.add(SUB);
group.add(MUL);
group.add(DIV);
p2.add(ADD);
p2.add(SUB);
p2.add(DIV);
p2.add(MUL);
//Create buttons
JButton NEXT = new JButton("NEXT");
JButton END = new JButton("End");
//Create Labels
JLabel l1 = new JLabel("First num");
JLabel l2 = new JLabel("Second num");
JLabel l3 = new JLabel("Answer:");
JLabel l4 = new JLabel("Score:");
final JLabel l5 = new JLabel("");
JLabel l6 = new JLabel("/");
final JLabel l7 = new JLabel("");
//Create Textfields
final JTextField number = new JTextField(Generator1());
final JTextField number2 = new JTextField(Generator1());
final JTextField answer = new JTextField(5);
//Add to panels
p1.add(l1);
p1.add(number);
p1.add(l2);
p1.add(number2);
p1.add(l3);
p1.add(answer);
p1.add(l4);
p1.add(l5);
p1.add(l6);
p1.add(l7);
p3.add(NEXT);
p3.add(END);
//Add panels
add(p2);
add(p1);
add(p3);
//Create Listners
NEXT.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int answer1 = 0;
//Grab the numbers entered
int numm1 = Integer.parseInt(number.getText());
int numm2 = Integer.parseInt(number2.getText());
int nummsanswer = Integer.parseInt(answer.getText());
//Set the score and total into new variabls
int nummscore = score;
int nummtotal = total;
//Check if the add radio button is selected if so add
if (ADD.isSelected() == true){
answer1 = numm1 + numm2;
//otherwise check if the subtract button is selected if so subtract
else if (SUB.isSelected() == true){
answer1 = numm1 - numm2;
//check if the multiplication button is selected if so multiply
else if (MUL.isSelected() == true){
answer1 = numm1 * numm2;
//check if the division button is selected if so divide
else if (DIV.isSelected() == true){
answer1 = numm1 / numm2;
//If the answer user entered is the same with th true answer
if (nummsanswer == answer1){
//add to the total and score
nummtotal += 1;
nummscore += 1;
//Convert the input back to String
String newscore = String.valueOf(nummscore);
String newtotal = String.valueOf(nummtotal);
//Set the text
l5.setText(newscore);
l7.setText(newtotal);
//Otherwise just increase the total counter
else {
nummtotal += 1;
String newtotal = String.valueOf(nummtotal);
l7.setText(newtotal);
//Create End listener
END.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// get the root window and call dispose on it
Window win = SwingUtilities.getWindowAncestor(p1);
win.dispose();
String Generator1(){
int randomnum;
randomnum = (1 + (int)(Math.random() * 20));
String randomnumm = String.valueOf(randomnum);
return randomnumm;
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
JFrame frame = new Grid();
frame.setTitle("Flashcard Testing");
frame.setSize(500, 200);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}Edited by: SirSaula on Dec 5, 2009 4:39 PMExtract code into methods, so that when an action is performed a method is called. That way you can reuse the method for purposes such as resetting textfields to their default values, scores to default values, etc.
You can go one step further and seperate the GUI layer from the processing layer, by deriving classes that for example maintain and calculate a score.
Mel -
AE CS5 Preference Settings Help!
Hi Guys,
I'm working with CS5 now. Can anyone help me configure the best settings in After Effects to get the most out of my PC and the software please?
PC configuration listed below. I have listed the current settings I have now for AE. Please advise what I should change.
Thank you in advance.
Regards.
Mark
My current preference:
General: Levels of Undo: 99 / Path Point Size = 5 pixels. The rest of the settings are default.
Previews: Adaptive Resolution Limit: 1/4. Enable Open GL is NOT checked. Zoom Quality=Faster, Color management=More accurate exept RAM preview,
Alternate RAM preview= 5 frames, audio preview=00:30:00
Display: Motion Path=selected is No More Than 00:15:00, nothing else is checked below
Import: Still Footage: Lenght of comp is selected at 00:01:00, Seq. footage=30 frames
Output, Grids & Guides and Lables are all default
Media & Disk Cache: Disk Cache=Enable Disk Cache is NOT checked, XMP Metadata=both are checked
Video Preview: PC Monitor only
Appearance: Default for checks, brightness=darkest setting, Affects label colors NOT checked
Auto Save: Automatically.... is checked, save every 10 min., Max project = 99
Memory & Multiprocessing: Shows Installed RAM: 16 GM, RAM reserved for other applications: 3 GB, RAM available for: AE, PP, En, Bridge: 13 GB,
After Effects Multiprocessing: Render Multiple Frames Simultaneously is NOT checked
Audio Hardware: MOTU
Audio Output: MOTU 1-2
• DAW I:
VisionDAW 4U 8-Core Xeon Workstation
2 Intel QUAD-Core Xeon 5365-3.0GHz, 8MB, 1333MHz Processors
16GB 667MHz Fully Buffered Server Memory Modules (2x2GB)
Microsoft® Windows® XP Professional x64 Edition
Microsoft® Windows® Windows 7 x64
WDC 250GB, Ultra ATA100, 7200 rpm, 8MG Buffer Main OS HD
2 WWDC 750GB, SATA II, 7200 RPM, 16MB Buffer HD (Raid 0)
2 WDC 750GB, SATA II, 7200 rpm, 16MG Buffer HD (Samples)
2 WDC 1TB Enterprise Class, SATA II, 7200 RPM, 32MB Buffer Hard Drive
MOTU 24 I/O (main) / MOTU 2408mk3 (slave)
Plexor PX-800A 18X Dbl. Layer DVD+/-RW Optical Drive
Buffalo BuRay Drive (External) BR-816SU2
Front Panel USB Acess
Integrated FireWire (1394a) interface
Thermaltake Toughpower 850W Power Supply
3xUAD1 Universal Audio Cards
NVIDIA QUADRO FX 1800 / Memory 768 MB GDDR3
CUDA Parallel Processor Cores / 64
Maximum Display Resolution Digital @60Hz = 2560x1600
Memory Interface 192Bit
Memory Bandwidth (GB/sec) / 38.4 GB/sec
PCI-Express, DUAL-Link DVI 1
Digital Outputs 3 (2 out of 3 active at a time)
Dual 25.5" Samsung 2693HM LCD HD MonitorsHello Todd,
Thanks for replying. My main concern is for the 3 preferences that are in bold. I was hoping that you (or someone) could suggest the best
settings for these three preferences based upon my PC specs.
If this machine was yours, how would you tweak these three preferences? -
Delete Keywords in Bridge? Re-import into Lightroom?
When I started trying Lightroom three weeks ago, I imported a few folders to learn with and created a keyword hierarchy.
Then when I imported all my photos, the keywords assigned in Bridge came along for the ride, giving me something to do with my time straighten it back to the structure I had created.
I use Bridge for renaming. Renaming my photos with the date first is a priority right now to help straighten out a mess of scanned photos not organized by date. It's been a slow process but necessary and I find it much easier to do in Bridge.
So now I know renaming files outside of Lightroom creates a problem. What will happen if I get rid of my Lightroom catalog; delete all keywords in Bridge (not a problem since I'm right now working in folders for renaming and can easily delete all keywords in the folder); then import all the renamed files into a new catalog in Lightroom.
Will the files keep the keywords written to them before in Lightroom even though I deleted keywords in Bridge? Or will I be deleting all keywords and have to start assigning them all over?
Hope this makes sense, I'm afraid to do anything right now!
PeggyPeggy,
I think that if you are creating a new Ligtroom catalog, and importing your photos, that they will reflect what you have done in Bridge.
But, to confirm that, I would suggest that you do a small test first:
Start Lightroom, create a new catalog, import say 5 photos and see what Lighroom shows as keywords. Select a photo in Lightroom, change its keywords, save the changes and see if Bridge shows the change. Do the same then in Bridge, and Lightroom should show an icon at the top right of the frame in Grid view. Right-Click on it and "read metadata from file". The keywords should show the Bridge changes.
I think you will see that Keywords operate fairly well between both programs. (If I had the time now I would have experimented for you, but I thought that suggesting something would be faster and work better).
I think that when you have finished all your keywording in Bridge, you can safely create Lighroom catalog and import all you photos, and the new Bridge keywords will be there. (None of the old Lightroom catalog keywords should show up).
p.s I am not atall sure of the syntax in Bridge for entering Parent-Child keywords, but Lightroom's syntax is Child>Parent. I had to think about the Lightroom syntax, because I always think the > is the "greater than" symbol in maths etc, but now I look at as a branching from Parent to Child. Amazing how the little things become " gotchas". -
How do I get live support for an import problem? Importing from 3.6 to the 5 beta, one folder with 4000+ images got into the wrong path and I have lost all my subfolders, and I can't reconstruct them, as when viewed in Windows Explorer all the folders are empty.. They are still intact in 3.6. What a mess.
1) Verify in LR 3.6 that the 4000 images have moved. You will see Library Grid view thumb nails, but look for a question mark "?" in the upper right corner of each frame. If you see the ?, LR 3.6 has confirmed the images are not where LR expects them to be.
2) Go to LR 5 and do the same thing, look for a ? in the image frame in Grid view. If not ?, at least you still have the images. Verify with a right click in the thumbnail, and select "Show in Explorer". This should will take you to Explorer in the folder that were LR 5 thinks the image is located. If this is successful, you at least have not lost the original images.
3) Do you have a backup of the original LR 3.6 image library? If yes, just restore. If no, then you may need to copy them in groups back folder by folder.
If you have to reconstruct the folder contents, I may have a suggestion to help make it easier. Put one dummy image in each of the empty folders and then Import them all into LR 5 with an ADD. This will then make all of the otherwise empty folders visible to LR 5. Once this is done you can then select the images for each folder in LR 5 and drag to the original folder from which it came. If they were all dropped in to one folder, they should be in sequence and it will not take that long.
Now to "How did you get this way?". LR Import has two options that don't disturb the original image, COPY & ADD, so it appears that you the third option MOVE. Hopefully the lesson learned is, don't use MOVE.
I hope this helps.
Bob McA -
Make a Panel disappear and appear again
Hi Team
I have a frame with Grid Layout where I have 3 Panels - P1, P2 and P3. I want that on the click on a button "+" P2 should disappear and P1 and P2 should align together. Again when the user click "-" button, P2 panel should appear again in its place between P1 and P3.
The problem with the visible(false) method is that it makes P2 Panel disappear but the space between P1 and P3 panels is still there.
Could anybody help me with this trivial issue
Thanks,
Mouser13019661 wrote:
Hi Team
I have a frame with Grid Layout where I have 3 Panels - P1, P2 and P3. I want that on the click on a button "+" P2 should disappear and P1 and P2 should align together. Again when the user click "-" button, P2 panel should appear again in its place between P1 and P3.
The problem with the visible(false) method is that it makes P2 Panel disappear but the space between P1 and P3 panels is still there.
Could anybody help me with this trivial issue
Thanks,
MoIn stead of making the panel invisible, remove it from the frame and trigger the frame to layout again (for example by calling pack() or revalidate()). -
Hi Experts,
We are SAP ECC 6.0 ( Apparel and Foot wear solutions ) , we run MRP on 3 months basis , our lead time for raw materials is 90 days , now when i run the MRP for the month of may , june , july the requriemnts of july , august , september are getting generated we will be having different release dates in the purchase requsitions as per the requriement.
For example we have a Purchase requistion for which the release date is 01/06/2010 , ( In this requistion the material is FFK and the grids are Black, WHite , Red) . i would have ordered only the Black grid for this month and the remaining grids are open )
now when i run the MRP run for next month and my requirement is less as compared to the preivous run , then the system should delete that two Grids from that PR and create new PR as the new requirment .
Is it Possible to do so . What is the standard functionlaity of the system , how does it work ,??
Regards
RakeshDear ,
Couple of question I would like to know :
1.What is the MRP type are you using because you can fix the Roll Forward Indicator at MRP type and also Roll Forward Period -SPRO-MRP-Planning -MRP Calcualtion -Planing Time fence and Roll forward period .HEre you can also set the Delete Firmed order .
The roll forward period defines a period for updating the master plan. In this period, the system deletes all firmed orders that lie before the roll forward period on the time axis.At the same time the system adjusts the master plan to a new situation, if necessary, that is, if new requirements have been created, new orders are created.
2.Any planning time fence ?
2.What is the time frame in Grids ? i means you want delete and recreate new planning considering grids ?? could please explain that .
R you running MRP with folloing set up ?
NETCH
Create PR -1
Schedule Line : 1
MRP List : 3
Planning Mode : Delete and Re-create Planning mode -3
Othewise you need to set Delivery Complete or Deletion flag for those grids of PR collectively and Run the MRP .
Try the above possibilites if you can or else set deletion flag or delivery complete indicator for those PR.
Regards
JH
Edited by: Jiaul Haque on May 25, 2010 3:27 PM -
Panels (align) disappear in FH MXa winXP
Have a dual screen setup with panels on right screen. Align
panel on left screen close to the toolbox. This have been working
fine for a long time, but suddenly all panels disappears when
launching FH. They pop up when I select them in windows menu. Fine.
But the Align panel vanishes when I click on it. I can click inside
the grid, and chose align settings from dropdown menues, but if I
try to move it, it disappears (clicking on top bar of panel)
Have tried to delete Prefs and relaunch but this doesn't
help. Have had problems with this before, but after I upgraded the
PCI-E Graphics Card the problems where gone. Until now. Working
fine yesterday, not today. Have not altered screen settings or done
anything else then just booting computer and using FH.
Anyone got a clue?
Best
Bjørn
Win XP Pro SP2
AMD Dual Core Opteron 165
2GB RAM
FH 11.02
Studio 8
Creative Suite CSuser13019661 wrote:
Hi Team
I have a frame with Grid Layout where I have 3 Panels - P1, P2 and P3. I want that on the click on a button "+" P2 should disappear and P1 and P2 should align together. Again when the user click "-" button, P2 panel should appear again in its place between P1 and P3.
The problem with the visible(false) method is that it makes P2 Panel disappear but the space between P1 and P3 panels is still there.
Could anybody help me with this trivial issue
Thanks,
MoIn stead of making the panel invisible, remove it from the frame and trigger the frame to layout again (for example by calling pack() or revalidate()). -
Print labview imaq image without border
I'm trying to print a labview imaq image by opening it in a new vi which is set to print on opening.
This works fine but, the size of the image can vary and the way I do it now, if the image does not completely fill the image frame, a grid is displayed in the area which is not filled by the image.
what it does:
|
|
|
|
|Hello Arend,
I attached a vi which you can use to read the size of the image you acquire and than scale the IMAQ Image Display according those settings. I also build a small example which shows how to use the subvi. They are both in the zip file. They are both written in LabVIEW 7.1 so if you're using an older version please tell me which and I will save it back.
Best Regards,
RikP
Application Engineering
National Instruments
Rik Prins, CLD
Applications Engineering Specialist Northern Europe, National Instruments
Please tip your answer providers with kudos.
Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
Attachments:
Autosize Image Display example.zip 27 KB
Maybe you are looking for
-
How to change the location of all fotos in the iPhoto library?
my iPhoto 11 library is stored locally on my macbook. however, my fotos (the actualy bits) are stored externally on a NAS box. (or in other words: option "Importing: [ ] Copy items to the iPhoto Library" is not checked) recently i purchased a timecap
-
Color management when printing from Reader 9
When printing from Adobe Reader 9 (Windows XP), the Advanced Print Setup gives the option "let printer determine colors". I presume that if this is selected the colors in the document will be sent unchanged to the printer. So, how does Reader 9 affec
-
Headphone jack problem with the zen mi
Not even 2 months after sending it in to be fixed, and I can't move my head without the sound getting distorted. Why don't they fix the problem not just make it work for a month in a half. Is there anyway to fix this withut sending it in?
-
Business Rule in BPC 5.1
Dear all, I got 2 questions regarding business rule: 1. There are 2 types of business rule. Script-based = You write your own script ( MdX or SQL logic)? Table-based = The table is more like a parameter table. You configure the parameters in the busi
-
I just updated my phone to the latest version.... but when restarting it asked for a passcode. I haven't had a passcode in at least six months and don't remember what my old one was. What can I do to access my phone?