953 Posted Topics
Re: how long I can't see old good assemler rounding method [CODE]a = a + .5;[/CODE] but rounding Double value in Jave should be [CODE] public class Round { public static double roundTo2Places(double value) { assert value >= Long.MIN_VALUE / 100 && value <= Long.MAX_VALUE / 100; long digits = (long) … | |
| |
Re: [url]http://download.oracle.com/javase/tutorial/uiswing/components/table.html[/url] [url]http://www.java2s.com/Code/Java/Swing-JFC/Table.htm[/url] + [url]http://www.java2s.com/Code/Java/Swing-JFC/Table-Column.htm[/url] + [url]http://www.java2s.com/Code/Java/Swing-JFC/Table-Renderer-Editor.htm[/url] + [url]http://www.java2s.com/Code/Java/Swing-JFC/Table-Model.htm[/url] | |
Re: here [url]http://www.daniweb.com/forums/thread348178.html[/url] | |
Re: no idea just [CODE]String rate = calcu(textBox1.getText() + " " + textBox2.getText());[/CODE] | |
Re: maybe not correct answer to your topic, but why not using for that some IDE (built-in funcioanlity), | |
Re: [CODE]I wanted to know if its possible to change the text of a JTextArea or JTextPanel[/CODE] yes [CODE]from another method[/CODE] yes [CODE]and if so how?[/CODE] well, but there are exists tons of methods that's descibed in API for exaxmple (with link to API too) [url]http://download.oracle.com/javase/tutorial/uiswing/components/textarea.html[/url] [url]http://download.oracle.com/javase/tutorial/uiswing/components/textfield.html[/url] [url]http://www.java2s.com/Code/Java/Swing-JFC/CatalogSwing-JFC.htm[/url] | |
Re: welcome on this forum [CODE] public static void main(String argv[]) { FVehicle driver = new FVehicle(); } [/CODE] | |
Re: why did you validate Date by using InputMask [url]http://download.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html#format[/url] add actionListener directly to the JButton, all methods pact to the separated void as f.e. doValidate() you have to set Focus to JComponents from void doValidate() int checkAge() 1/ value for Calendar and Date prepare outSide this methods, sure you can … | |
Re: start with [url]http://download.oracle.com/javase/tutorial/index.html[/url] and tons of examples [url]http://www.java2s.com/[/url] | |
Re: [url]http://download.oracle.com/javase/tutorial/uiswing/examples/components/ButtonDemoProject/src/components/ButtonDemo.java[/url] tutorial [url]http://download.oracle.com/javase/tutorial/uiswing/components/button.html[/url] | |
Re: put that into JScrollPane f.e. [CODE]import java.awt.BorderLayout; import java.awt.GridLayout; import javax.swing.*; public class SomeGridLayout extends JPanel { private final int VERT_STRUT = 100; private final int WEST_GRID_HGAP = 10; private final String TEST_BIGTEXT = "<html><body><h2>Path</h2>toto/tutu/tata/TestN<h2>" + "Prerequisites</h2>blah blah blah blah<br/><b>blah blah</b> blah blah\nblah blah <u>blah</u> " + "blahblah blah blah<h2>Description</h2>blah … | |
Re: [url]www.mySQL.com[/url] [url]http://www.java2s.com/Tutorial/MySQL/CatalogMySQL.htm[/url] and google | |
Re: yes that's possible, you can create methods [CODE] public JLabel myLabel{ //create JLabel return; } //or public class myLabel extends JLabel{ //create JLabel } [/CODE] samples code [url]http://download.oracle.com/javase/tutorial/uiswing/index.html[/url] [url]http://www.java2s.com/Code/Java/CatalogJava.htm[/url] | |
Re: 1/ what you are tried to tell ..., this man meaning runnable definitions about "how you wrote your JTable" 2/ be sure that more complete JTable definitions is just about 80-120 code lines, only for JTable 3/ and don't swith Input/Output to another JFrame, replace that with JDialog, 4/ "how … | |
Re: hmmm how many post, my magic ball is tired, no idea how - where - why, only/maybe if you shows that | |
Re: Hmmm, please nothing to your topics 1/ maybe open connection on App startUp, close that on App Exit, to avoid long task during ActionPerformed (from JButton???), in your case GUI probably freeze for second and more ... 2/ there nothing about Object (mo), if is TableModel, TreeModel then you can … | |
Re: JComponent#setComponentOrientation, please be sure that you will use a Swing Components, meaning start with letter "J", f.e. JTextField, JButton etc [url]http://download.oracle.com/javase/tutorial/uiswing/layout/using.html#orientation[/url] | |
Re: welcome on this forum, [CODE] public class MetricConverterApp extends JFrame implements ActionListener{ JButton metWeight; public MetricConverterApp(){ . . . . . . metWeight = new JButton("Convert to kilograms"); jp1.add(metWeight, BorderLayout.EAST); metWeight.addActionListener(this); [/CODE] and every JTextField (where you want to input Numeric value) should be JFormattedTextField don't extends and implements in … | |
Re: you have to add User Data Source in Win or using 3rd. party Driver | |
Re: be sure doing [CODE]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Frm.FinalProject$CalcBtnListener.actionPerformed(FinalProject.java:88) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) … | |
Re: its nothing to do with java, even/but at fistr of all: are you search for some Camera set that's really implements your .. (camera chipset + Sw), aren't you if yes, then is: - camera able (automatic option for Face Detection) to create image - camera able (camera chipset + … | |
Re: long time i nothing to do (meaning compile, just import workbech) in Eclipse, but other IDE has project properties, where you can set main class by name (if needed with argument too, but I think that isn't your..) | |
Re: sure I don't understaodd exactly what are you tried to archieve, sorry my magic ball is tired, only continue by reads comment [CODE]System.out.print("Sorted");[/CODE] if I add [CODE]Arrays.sort(sel);[/CODE] then outPut ... [CODE] import java.util.Arrays; public class NicoleSelSort { public static void main(String[] args) { int[] sel = new int[100]; System.out.print("Unsorted"); for … | |
Re: [CODE]for(count = 0; count < employees.size; count++){[/CODE] | |
| |
Re: which Timer 1/ java.util.Timer 2/ java.swing.Timer | |
Re: no idea, sure maybe this one can hepl you [url]http://www.trl.ibm.com/aglets/about_e.htm[/url] but carrefully reads this line "Last modified 14 March, 2002" on page bottom, and maybe works and on todays PC with Java 6 ask author for support | |
Re: [url]http://download.oracle.com/javase/tutorial/essential/exceptions/index.html[/url] but [CODE] If(files.length>0){// check array for (int i = 0; i < files.length; i++){ //some stuff } } if (file.exists()){ // check path //something with Drive, Folder or File } [/CODE] | |
Re: maybe this one can help you with... [url]http://www.javaworld.com/jw-12-2000/jw-1229-traps.html[/url] | |
Re: that's very old API, isn't good idea 1/ remove import from MyDialog class, because isn't necessary ..., and used too [CODE] import com.ibm.agletx.util.SimpleItinerary; [/CODE] 2/ please there are Eclipse and Netbeans and both are free, there you can write/import, then debug/run your code more confortly as from command Line, 3/ … | |
Re: [url]http://www.java2s.com/Code/Java/Database-SQL-JDBC/Excel.htm[/url] but you have to create user DNS for MsExcel in Windows before that or by using Apache POI | |
Re: then always check whether if it exists before for example on [url]http://www.java2s.com/Code/Java/Data-Type/CatalogData-Type.htm[/url] date Format, date Parser and Date, be sure that you'll put it together ... | |
Re: maybe there you can find ... [CODE] import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class GenerateProgresId { private static String[] aChar = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; private static … | |
Re: huuuh...., please what are you tied with [CODE]#else if ((isConnected !=false) && (isConnected !=true)){[/CODE] you can test (if - if else - else) boolean value directly [CODE] if(isConnected){ if(OneKid){ //some stuff } if(!OneKid){ //some reversal stuff } //some stuff }else{ //some stuff } [/CODE] | |
Re: just some ..., no FW (that's about e.getSource()) - have to create GUI on EDT (main method) - have to place, size, pack TopLayoutContainer, and then visible container - you are set LayoutManager correctly, then there is no longer needed something about ContentPane, (hmmmm, sure backGround Color, but just for … ![]() | |
Re: if returns same value, no idea | |
Re: please (if isn't there Ldap, AD...) be sure that you don't store sesitive (User + Psw) data in String form somewhere in your App, because all String variable (private Strin UseName = "John";) are readable (runnable compilated code) from any fileViewer (after compilation there you can find out "John"), that's … | |
Re: Swing is strictly single threaded, and all code must be done on EDT and your JComponents always wait for long iterations, GUI's freeeze during this long operation you have to move your iterations to the backGround Task 1/ using SwingWorker (this section contains Concurency, EDT a SwingWorker) [url]http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html[/url] be sure … | |
Re: sure there is better to use a proper LayoutManager [CODE] Font font = jButton1.getFont(); FontMetrics fontMetrics = jButton1.getFontMetrics(font); maxWidth = SwingUtilities.computeStringWidth(fontMetrics, text); [/CODE] | |
Re: [CODE] public boolean FailurePoint(int selectedNodes[], CyNetwork network) { int kids[] = network.getAdjacentEdgeIndicesArray(selectedNodes[0], false, true, true); int[] ChildNode = new int[kids.length]; for (int c = 0; c < ChildNode.length; c++) { int node = network.getEdgeSourceIndex(kids[c]); if (node == selectedNodes[0]) { node = network.getEdgeTargetIndex(kids[c]); } ChildNode[c] = node; } Vector<Integer> cnodes = … | |
Re: maybe this one (if you needed pass path in String form) [url]http://www.java2s.com/Code/Java/2D-Graphics-GUI/DisplayimagesupportedbyImageIO.htm[/url] [CODE] try { image = ImageIO.read(new File(filename)); } catch (IOException ie) { ie.printStackTrace(); } [/CODE] | |
Re: that's simplier as I ever seen, what do you meaning about this one [CODE] import java.awt.*; import java.awt.geom.*; import java.awt.image.BufferedImage; import javax.swing.*; public class Background extends JPanel { private static final long serialVersionUID = 1L; private BufferedImage image; private Ellipse2D.Double ball; @Override protected void paintComponent(Graphics g) { Graphics2D g2 = … | |
Re: the you can (probably) use a some of Set, that doesn't allows duplicates, and you can test it with methods someSet#contains | |
Re: there is basic inc. JTreeNode, Model etc [url]http://www.java2s.com/Code/Java/Swing-JFC/Tree.htm[/url] and [url]http://download.oracle.com/javase/tutorial/uiswing/components/tree.html[/url] and why swing doesn't works [url]http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html[/url] | |
Re: 1/ initial delay is int, where TimeUnit == miliseconds not 0010, sure for preprocesor is this "value" only 10miliseconds but... 2/ usage for java.swing.TImer shloud be (and check Timer#methods f.e. timer.setDelay(int i)) [CODE] private void prepareStartShedule() { timerRun = new javax.swing.Timer(delay / 10, startCycle()); timerRun.setRepeats(false); timerRun.start(); } private Action startCycle() … |
The End.