The SSCCE is back!

JAVA

    Sponsored Links

    Next

  • 1. optimization
    Hello, I am creating a tag-lib. My tags use constructs like the one below pretty much everywhere. Questions for you: - is there place for optimization? - if yes, is this one of those cases where optimization would be so minimal that it's not worth the loss in code readibility? thank you luca out.print(" <td attr=\""+attr+"\">"); String an = ""; if (cond1) { out.print(" "+an); if (document != null && !somestring.equals("")) { if (cond2) { out.print(" <img attr2=\""+attr2+"\" src=\"\" alt=\"\"/>"); } } out.print(" <a attr3=\""+an+"\""); } else { if (!accesskey.equals("")) { out.print(" "+otherstring+" <a attr3=\""+attr3+"\""); } else { out.print("<a"); } } out.print(" href=\""+href+"\""); //title is optional if (!title.equals("")) { out.print(" title=\""+title+"\""); } out.print(">");
  • 2. TabbedPane question
    Hello, Say I've got a TabbedPane gui with two tabs. Is it possible to hide the second tab until/unless a certain radio button is clicked on the first tab? I'm building a small program that allows users to order books, and they have a choice as to whether or not they want to have it shipped to them or not. If they want to have it shipped, then they have to enter their address, and I have my second tab set up with Address/City/State/Zip Code text boxes laid out. But I don't want this tab even seen unless the buyer selects the YES radio button for shipping. I've searched high and low for any documentation or examples on how to do this, but I can't seem to find any. I'd appreciate any guidance. Thanks! Frank
  • 3. java web start OUPS!
    ha.........HA! I forgot to say it is an applet. I found that in some docs. <applet-desc width="300" height="200" name="WriteFile" main-class="WriteFile"/> It works. :-) Jean
  • 4. Newbie array question???
    I have an assignment where I need to determine the gross wages for 5 employees using 4 arrays, empId ( ID numbers are given), hours array, payRate array, and a wages array to store the info for the final print which will include all 5 employees. We are using JOptionPane as the input source for the info and I am stumped on how to accomplish this. It should work like this: Display employee ID number and then ask the employees hours worked and then payRate, then calculate each employees gross wages and store them in a wages array awaiting the final display. Any help would be greatly appreciated. Newbie Bob

The SSCCE is back!

Postby Andrew Thompson » Sun, 06 Aug 2006 23:38:39 GMT

The document on the ..

  Short, Self Contained, Compilable, Example

also known as an SSCCE, is back up at PhySci.

The URL is < http://www.**--****.com/ ;

N.B. X-post to c.l.j.programmer & c.l.j.help with
follow-ups to c.l.j.help ONLY.

Set groups and follow-ups as you see fit.

Andrew T.


Re: The SSCCE is back!

Postby hiwa » Mon, 07 Aug 2006 14:27:44 GMT

Andrew Thompson :

Thanks. The document is great.
It's sad that it is yet to become a common sense
among forum/news group posters.


Re: The SSCCE is back!

Postby hiwa » Tue, 08 Aug 2006 19:03:41 GMT

Andrew Thompson :

Thanks. The document is great.
It's sad that it does yet become popular common sense among forum
posters.


Similar Threads:

1.i am developing a banking application in J2SE with MySQL Server as back end

the application has a JFrame menu bar with menu items as login,
customer, and transaction.

customer has three pop-up menu items namely government, corporate &
individual.

transaction has two pop-up menu items namely deposit check, withdraw
cash.

when i click on login a dialog box should pop-up within the JFrame
asking for user's id and password, the user can be either a teller,
manager, sys admin.

once the authentication ( by validating the user credentials with MySQL
server bank staff database) is done, a MDI type window pops-up with
text box for entering the type of customer, text box for organization/
individual's name, address etc. or enter a new customer info. and store
it in MySQL database.

then clcik on transaction and proceed with a similar GUI and  conduct
the transaction and update the database.

i don't know if JFrame is the way to go or ?

would help if someone provides some source code.

regards, Ben

2.SSCCE

i have read your note on the above topic but the code in my last post
2005-01-05 is correct (no error) and it is compilable, but i don't know
where the problem is given the error (Start: Applet not initialized).

3.Time to ditch "SSCCE"?

4.REAL SSCCE of my graphical interface with memory leaks

Hi All!
I've some problems with a java program and memory leaks.
I Export the classes in a jar file (with eclipse) and i run it with:
java -jar app.jar

If i see the memory occupation of the program  (CTRL+ALT+CANC
java.exe application) i can see that the memory start from 14.600 KB
and then grows up...

Why it appends?

Best Regards

Sal

<MAIN CLASS>
package inter;

public class Principale {

public static void main(String[] args) {

try {
Interfaccia2 app = new Interfaccia2();
} catch (NullPointerException e) {}
}
}
</MAIN CLASS>

<INTERFACE CLASS>
package inter;

import javax.swing.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;

public class Interfaccia2 extends JFrame
{
JFrame f;
JLabel timeField;
int day = 0;
int mese = 0;
int anno = 0;
int h = 0;
int m = 0;
int s = 0;
Font fontlabel = new Font( "Verdana",Font.PLAIN,14);
Dimension screenSize =Toolkit.getDefaultToolkit().getScreenSize();
public Interfaccia2()
{
timeField = new JLabel("");
javax.swing.Timer t = new javax.swing.Timer(1000,
new ActionListener() {
public void actionPerformed(ActionEvent e) {
Calendar now = Calendar.getInstance();
day = now.get(Calendar.DAY_OF_MONTH);
mese = now.get(Calendar.MONTH)+1;
anno = now.get(Calendar.YEAR);
h = now.get(Calendar.HOUR_OF_DAY);
m = now.get(Calendar.MINUTE);
s = now.get(Calendar.SECOND);
timeField.setText("Data: "+ day + "-"  + mese + "-" + anno + "
Ore: "  + h + ":" + m + ":" + s);
}
});
t.start();  // Start the timer
timeField.setFont(fontlabel);
JPanel Panel_principale = new JPanel();
Panel_principale.setPreferredSize (new Dimension (screenSize.width-10,
screenSize.height-65));
Panel_principale.add (timeField);
f = new JFrame ("TK Data");
f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
f.getContentPane().add (Panel_principale);
f.pack();
f.setVisible (true);
f.repaint();
}
}
</INTERFACE CLASS>

5.SSCCE - updated

6. SSCCE of my graphical interface with memory leak

7. SSCCE starts with 'short', not 'simple'!

8. Custom array list not sorting with Collections.sort() + SSCCE



Return to JAVA

 

Who is online

Users browsing this forum: No registered users and 11 guest