List of usage examples for java.util.logging Level SEVERE
Level SEVERE
To view the source code for java.util.logging Level SEVERE.
Click Source Link
From source file:org.eclipse.lyo.client.oslc.samples.RTCFormSample.java
/** * Login to the RTC server and perform some OSLC actions * @param args/*from w w w . j a v a2 s . co m*/ * @throws ParseException */ public static void main(String[] args) throws ParseException { Options options = new Options(); options.addOption("url", true, "url"); options.addOption("user", true, "user ID"); options.addOption("password", true, "password"); options.addOption("project", true, "project area"); CommandLineParser cliParser = new GnuParser(); //Parse the command line CommandLine cmd = cliParser.parse(options, args); if (!validateOptions(cmd)) { logger.severe( "Syntax: java <class_name> -url https://<server>:port/<context>/ -user <user> -password <password> -project \"<project_area>\""); logger.severe( "Example: java RTCFormSample -url https://exmple.com:9443/ccm -user ADMIN -password ADMIN -project \"JKE Banking (Change Management)\""); return; } String webContextUrl = cmd.getOptionValue("url"); String user = cmd.getOptionValue("user"); String passwd = cmd.getOptionValue("password"); String projectArea = cmd.getOptionValue("project"); try { //STEP 1: Initialize a Jazz rootservices helper and indicate we're looking for the ChangeManagement catalog //RTC contains a service provider for CM and SCM, so we need to indicate our interest in CM JazzRootServicesHelper helper = new JazzRootServicesHelper(webContextUrl, OSLCConstants.OSLC_CM_V2); //STEP 2: Create a new Form Auth client with the supplied user/password JazzFormAuthClient client = helper.initFormClient(user, passwd); //STEP 3: Login in to Jazz Server if (client.formLogin() == HttpStatus.SC_OK) { //STEP 4: Get the URL of the OSLC ChangeManagement catalog String catalogUrl = helper.getCatalogUrl(); //STEP 5: Find the OSLC Service Provider for the project area we want to work with String serviceProviderUrl = client.lookupServiceProviderUrl(catalogUrl, projectArea); //STEP 6: Get the Query Capabilities URL so that we can run some OSLC queries String queryCapability = client.lookupQueryCapability(serviceProviderUrl, OSLCConstants.OSLC_CM_V2, OSLCConstants.CM_CHANGE_REQUEST_TYPE); //SCENARIO A: Run a query for all open ChangeRequests with OSLC paging of 10 items per //page turned on and list the members of the result OslcQueryParameters queryParams = new OslcQueryParameters(); queryParams.setWhere("oslc_cm:closed=false"); queryParams.setSelect("dcterms:identifier,dcterms:title,oslc_cm:status"); OslcQuery query = new OslcQuery(client, queryCapability, 10, queryParams); OslcQueryResult result = query.submit(); boolean processAsJavaObjects = true; processPagedQueryResults(result, client, processAsJavaObjects); System.out.println("\n------------------------------\n"); //SCENARIO B: Run a query for a specific ChangeRequest selecting only certain //attributes and then print it as raw XML. Change the dcterms:identifier below to match a //real workitem in your RTC project area OslcQueryParameters queryParams2 = new OslcQueryParameters(); queryParams2.setWhere("dcterms:identifier=\"10\""); queryParams2.setSelect( "dcterms:identifier,dcterms:title,dcterms:creator,dcterms:created,oslc_cm:status"); OslcQuery query2 = new OslcQuery(client, queryCapability, queryParams2); OslcQueryResult result2 = query2.submit(); ClientResponse rawResponse = result2.getRawResponse(); processRawResponse(rawResponse); rawResponse.consumeContent(); //SCENARIO C: RTC Workitem creation and update ChangeRequest changeRequest = new ChangeRequest(); changeRequest.setTitle("Implement accessibility in Pet Store application"); changeRequest.setDescription( "Image elements must provide a description in the 'alt' attribute for consumption by screen readers."); changeRequest.addTestedByTestCase(new Link(new URI("http://qmprovider/testcase/1"), "Accessibility verification using a screen reader")); changeRequest.addDctermsType("task"); //Get the Creation Factory URL for change requests so that we can create one String changeRequestCreation = client.lookupCreationFactory(serviceProviderUrl, OSLCConstants.OSLC_CM_V2, changeRequest.getRdfTypes()[0].toString()); //Create the change request ClientResponse creationResponse = client.createResource(changeRequestCreation, changeRequest, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML); String changeRequestLocation = creationResponse.getHeaders().getFirst(HttpHeaders.LOCATION); creationResponse.consumeContent(); System.out.println("Change Request created a location " + changeRequestLocation); //Get the change request from the service provider and update its title property changeRequest = client.getResource(changeRequestLocation, OslcMediaType.APPLICATION_RDF_XML) .getEntity(ChangeRequest.class); changeRequest.setTitle(changeRequest.getTitle() + " (updated)"); //Create a partial update URL so that only the title will be updated. //Assuming (for readability) that the change request URL does not already contain a '?' String updateUrl = changeRequest.getAbout() + "?oslc.properties=dcterms:title"; //Update the change request at the service provider ClientResponse updateResponse = client.updateResource(updateUrl, changeRequest, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML); updateResponse.consumeContent(); } } catch (RootServicesException re) { logger.log(Level.SEVERE, "Unable to access the Jazz rootservices document at: " + webContextUrl + "/rootservices", re); } catch (Exception e) { logger.log(Level.SEVERE, e.getMessage(), e); } }
From source file:it.unipd.dei.ims.falcon.CmdLine.java
public static void main(String[] args) { // last argument is always index path Options options = new Options(); // one of these actions has to be specified OptionGroup actionGroup = new OptionGroup(); actionGroup.addOption(new Option("i", true, "perform indexing")); // if dir, all files, else only one file actionGroup.addOption(new Option("q", true, "perform a single query")); actionGroup.addOption(new Option("b", false, "perform a query batch (read from stdin)")); actionGroup.setRequired(true);//from w w w.j a v a2 s . c om options.addOptionGroup(actionGroup); // other options options.addOption(new Option("l", "segment-length", true, "length of a segment (# of chroma vectors)")); options.addOption( new Option("o", "segment-overlap", true, "overlap portion of a segment (# of chroma vectors)")); options.addOption(new Option("Q", "quantization-level", true, "quantization level for chroma vectors")); options.addOption(new Option("k", "min-kurtosis", true, "minimum kurtosis for indexing chroma vectors")); options.addOption(new Option("s", "sub-sampling", true, "sub-sampling of chroma features")); options.addOption(new Option("v", "verbose", false, "verbose output (including timing info)")); options.addOption(new Option("T", "transposition-estimator-strategy", true, "parametrization for the transposition estimator strategy")); options.addOption(new Option("t", "n-transp", true, "number of transposition; if not specified, no transposition is performed")); options.addOption(new Option("f", "force-transp", true, "force transposition by an amount of semitones")); options.addOption(new Option("p", "pruning", false, "enable query pruning; if -P is unspecified, use default strategy")); options.addOption(new Option("P", "pruning-custom", true, "custom query pruning strategy")); // parse HelpFormatter formatter = new HelpFormatter(); CommandLineParser parser = new PosixParser(); CommandLine cmd = null; try { cmd = parser.parse(options, args); if (cmd.getArgs().length != 1) throw new ParseException("no index path was specified"); } catch (ParseException ex) { System.err.println("ERROR - parsing command line:"); System.err.println(ex.getMessage()); formatter.printHelp("falcon -{i,q,b} [options] index_path", options); return; } // default values final float[] DEFAULT_TRANSPOSITION_ESTIMATOR_STRATEGY = new float[] { 0.65192807f, 0.0f, 0.0f, 0.0f, 0.3532628f, 0.4997167f, 0.0f, 0.41703504f, 0.0f, 0.16297342f, 0.0f, 0.0f }; final String DEFAULT_QUERY_PRUNING_STRATEGY = "ntf:0.340765*[0.001694,0.995720];ndf:0.344143*[0.007224,0.997113];" + "ncf:0.338766*[0.001601,0.995038];nmf:0.331577*[0.002352,0.997884];"; // TODO not the final one int hashes_per_segment = Integer.parseInt(cmd.getOptionValue("l", "150")); int overlap_per_segment = Integer.parseInt(cmd.getOptionValue("o", "50")); int nranks = Integer.parseInt(cmd.getOptionValue("Q", "3")); int subsampling = Integer.parseInt(cmd.getOptionValue("s", "1")); double minkurtosis = Float.parseFloat(cmd.getOptionValue("k", "-100.")); boolean verbose = cmd.hasOption("v"); int ntransp = Integer.parseInt(cmd.getOptionValue("t", "1")); TranspositionEstimator tpe = null; if (cmd.hasOption("t")) { if (cmd.hasOption("T")) { // TODO this if branch is yet to test Pattern p = Pattern.compile("\\d\\.\\d*"); LinkedList<Double> tokens = new LinkedList<Double>(); Matcher m = p.matcher(cmd.getOptionValue("T")); while (m.find()) tokens.addLast(new Double(cmd.getOptionValue("T").substring(m.start(), m.end()))); float[] strategy = new float[tokens.size()]; if (strategy.length != 12) { System.err.println("invalid transposition estimator strategy"); System.exit(1); } for (int i = 0; i < strategy.length; i++) strategy[i] = new Float(tokens.pollFirst()); } else { tpe = new TranspositionEstimator(DEFAULT_TRANSPOSITION_ESTIMATOR_STRATEGY); } } else if (cmd.hasOption("f")) { int[] transps = parseIntArray(cmd.getOptionValue("f")); tpe = new ForcedTranspositionEstimator(transps); ntransp = transps.length; } QueryPruningStrategy qpe = null; if (cmd.hasOption("p")) { if (cmd.hasOption("P")) { qpe = new StaticQueryPruningStrategy(cmd.getOptionValue("P")); } else { qpe = new StaticQueryPruningStrategy(DEFAULT_QUERY_PRUNING_STRATEGY); } } // action if (cmd.hasOption("i")) { try { Indexing.index(new File(cmd.getOptionValue("i")), new File(cmd.getArgs()[0]), hashes_per_segment, overlap_per_segment, subsampling, nranks, minkurtosis, tpe, verbose); } catch (IndexingException ex) { Logger.getLogger(CmdLine.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(CmdLine.class.getName()).log(Level.SEVERE, null, ex); } } if (cmd.hasOption("q")) { String queryfilepath = cmd.getOptionValue("q"); doQuery(cmd, queryfilepath, hashes_per_segment, overlap_per_segment, nranks, subsampling, tpe, ntransp, minkurtosis, qpe, verbose); } if (cmd.hasOption("b")) { try { long starttime = System.currentTimeMillis(); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = null; while ((line = in.readLine()) != null && !line.trim().isEmpty()) doQuery(cmd, line, hashes_per_segment, overlap_per_segment, nranks, subsampling, tpe, ntransp, minkurtosis, qpe, verbose); in.close(); long endtime = System.currentTimeMillis(); System.out.println(String.format("total time: %ds", (endtime - starttime) / 1000)); } catch (IOException ex) { Logger.getLogger(CmdLine.class.getName()).log(Level.SEVERE, null, ex); } } }
From source file:com.firmansyah.imam.sewa.kendaraan.FormLogin.java
/** * @param args the command line arguments *//*w w w.jav a 2s .c om*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new FormLogin().setVisible(true); } }); }
From source file:base64.string_manipulation.Test_Frame.java
/** * @param args the command line arguments *//*w w w . j av a2 s. c o m*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Test_Frame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Test_Frame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Test_Frame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Test_Frame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Test_Frame().setVisible(true); } }); }
From source file:com.guns.media.tools.yuv.MediaTool.java
/** * @param args the command line arguments *//* ww w. j a v a2 s .com*/ public static void main(String[] args) throws IOException { try { Options options = getOptions(); CommandLine cmd = null; int offset = 0; CommandLineParser parser = new GnuParser(); cmd = parser.parse(options, args); if (cmd.hasOption("help")) { printHelp(options); exit(1); } if (cmd.hasOption("offset")) { offset = new Integer(cmd.getOptionValue("offset")); } int frame = new Integer(cmd.getOptionValue("f")); // int scale = new Integer(args[2]); BufferedInputStream if1 = new BufferedInputStream(new FileInputStream(cmd.getOptionValue("if1"))); BufferedInputStream if2 = new BufferedInputStream(new FileInputStream(cmd.getOptionValue("if2"))); DataStorage.create(new Integer(cmd.getOptionValue("f"))); int width = new Integer(cmd.getOptionValue("w")); int height = new Integer(cmd.getOptionValue("h")); LookUp.initSSYUV(width, height); // int[][] frame1 = new int[width][height]; // int[][] frame2 = new int[width][height]; int nRead; int fRead; byte[] data = new byte[width * height + ((width * height) / 2)]; byte[] data1 = new byte[width * height + ((width * height) / 2)]; int frames = 0; long start_ms = System.currentTimeMillis() / 1000L; long end_ms = start_ms; if (offset > 0) { if1.skip(((width * height + ((width * height) / 2)) * offset)); } else if (offset < 0) { if2.skip(((width * height + ((width * height) / 2)) * (-1 * offset))); } if (cmd.hasOption("psnr")) { ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newCachedThreadPool(); while ((nRead = if1.read(data)) != -1 && ((fRead = if2.read(data1)) != -1) && frames < frame) { byte[] data_out = data.clone(); byte[] data1_out = data1.clone(); PSNRCalculatorThread wt = new PSNRCalculatorThread(data_out, data1_out, frames, width, height); executor.execute(wt); frames++; } executor.shutdown(); end_ms = System.currentTimeMillis(); System.out.println("Frame Rate :" + frames * 1000 / ((end_ms - start_ms))); for (int i = 0; i < frames; i++) { System.out.println( i + "," + 10 * Math.log10((255 * 255) / (DataStorage.getFrame(i) / (width * height)))); } } if (cmd.hasOption("sub")) { RandomAccessFile raf = new RandomAccessFile(cmd.getOptionValue("o"), "rw"); ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newCachedThreadPool(); while ((nRead = if1.read(data)) != -1 && ((fRead = if2.read(data1)) != -1)) { byte[] data_out = data.clone(); byte[] data1_out = data1.clone(); ImageSubstractThread wt = new ImageSubstractThread(data_out, data1_out, frames, width, height, raf); //wt.run(); executor.execute(wt); frames++; } executor.shutdown(); end_ms = System.currentTimeMillis() / 1000L; System.out.println("Frame Rate :" + frames / ((end_ms - start_ms))); raf.close(); } if (cmd.hasOption("ss") && !cmd.getOptionValue("o").matches("-")) { RandomAccessFile raf = new RandomAccessFile(cmd.getOptionValue("o"), "rw"); // RandomAccessFile ra = new RandomAccessFile(cmd.getOptionValue("o"), "rw"); // MappedByteBuffer raf = new RandomAccessFile(cmd.getOptionValue("o"), "rw").getChannel().map(FileChannel.MapMode.READ_WRITE, 0, ((width*height)+(width*height/2))*frame); ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newCachedThreadPool(); while ((nRead = if1.read(data)) != -1 && ((fRead = if2.read(data1)) != -1) && frames < frame) { byte[] data_out = data.clone(); byte[] data1_out = data1.clone(); SidebySideImageThread wt = new SidebySideImageThread(data_out, data1_out, frames, width, height, raf); // MPSidebySideImageThread wt = new MPSidebySideImageThread(data_out, data1_out, frames, width, height, ra); frames++; // wt.run(); executor.execute(wt); } executor.shutdown(); end_ms = System.currentTimeMillis() / 1000L; while (!executor.isTerminated()) { } raf.close(); } if (cmd.hasOption("ss") && cmd.getOptionValue("o").matches("-")) { PrintStream stdout = new PrintStream(System.out); // RandomAccessFile ra = new RandomAccessFile(cmd.getOptionValue("o"), "rw"); // MappedByteBuffer raf = new RandomAccessFile(cmd.getOptionValue("o"), "rw").getChannel().map(FileChannel.MapMode.READ_WRITE, 0, ((width*height)+(width*height/2))*frame); // ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newCachedThreadPool(); while ((nRead = if1.read(data)) != -1 && ((fRead = if2.read(data1)) != -1) && frames < frame) { byte[] data_out = data.clone(); byte[] data1_out = data1.clone(); SidebySideImageThread wt = new SidebySideImageThread(data_out, data1_out, frames, width, height, stdout); // MPSidebySideImageThread wt = new MPSidebySideImageThread(data_out, data1_out, frames, width, height, ra); frames++; // wt.run(); wt.run(); } end_ms = System.currentTimeMillis() / 1000L; System.out.println("Frame Rate :" + frames / ((end_ms - start_ms))); stdout.close(); } if (cmd.hasOption("image")) { System.setProperty("java.awt.headless", "true"); //ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newCachedThreadPool(); ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(10); while ((nRead = if1.read(data)) != -1 && ((fRead = if2.read(data1)) != -1)) { if (frames == frame) { byte[] data_out = data.clone(); byte[] data1_out = data1.clone(); Frame f1 = new Frame(data_out, width, height, Frame.YUV420); Frame f2 = new Frame(data1_out, width, height, Frame.YUV420); // System.out.println(cmd.getOptionValue("o")); ExtractImageThread wt = new ExtractImageThread(f1, frames, cmd.getOptionValue("if1") + "frame1-" + cmd.getOptionValue("o")); ExtractImageThread wt1 = new ExtractImageThread(f2, frames, cmd.getOptionValue("if2") + "frame2-" + cmd.getOptionValue("o")); // executor.execute(wt); executor.execute(wt); executor.execute(wt1); } frames++; } executor.shutdown(); // executor.shutdown(); end_ms = System.currentTimeMillis() / 1000L; System.out.println("Frame Rate :" + frames / ((end_ms - start_ms))); } } catch (ParseException ex) { Logger.getLogger(MediaTool.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:config.Timers.java
/** * @param args the command line arguments *///from w ww .j a va 2 s . co m public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Timers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Timers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Timers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Timers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { Timers dialog = new Timers(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); }
From source file:com.github.vatbub.tictactoe.view.Main.java
public static void main(String[] args) { Common.getInstance().setAppName("tictactoev2"); FOKLogger.enableLoggingOfUncaughtExceptions(); try {//from w w w .j a va2s .c om applicationConfiguration = new Config(new URL( "https://raw.githubusercontent.com/vatbub/tictactoe/master/remoteconfig/client.properties"), Main.class.getResource("fallbackConfig.properties"), true, "tictactoeClientConfigCache.properties", true); } catch (IOException e) { FOKLogger.log(Main.class.getName(), Level.SEVERE, "Could not read the remote config", e); } for (String arg : args) { if (arg.toLowerCase().matches("mockappversion=.*")) { // Set the mock version String version = arg.substring(arg.toLowerCase().indexOf('=') + 1); Common.getInstance().setMockAppVersion(version); } else if (arg.toLowerCase().matches("mockbuildnumber=.*")) { // Set the mock build number String buildnumber = arg.substring(arg.toLowerCase().indexOf('=') + 1); Common.getInstance().setMockBuildNumber(buildnumber); } else if (arg.toLowerCase().matches("mockpackaging=.*")) { // Set the mock packaging String packaging = arg.substring(arg.toLowerCase().indexOf('=') + 1); Common.getInstance().setMockPackaging(packaging); } else if (arg.toLowerCase().matches("locale=.*")) { // set the gui language String guiLanguageCode = arg.substring(arg.toLowerCase().indexOf('=') + 1); FOKLogger.info(Main.class.getName(), "Setting language: " + guiLanguageCode); Locale.setDefault(new Locale(guiLanguageCode)); } } launch(args); }
From source file:vic.collaborativeClouds.forms.Login.java
/** * @param args the command line arguments *//* ww w. jav a 2s . c o m*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Login().setVisible(true); } }); }
From source file:com.hss.assignment4.LoginFrame.java
/** * @param args the command line arguments */// w ww. j av a2 s. co m public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(LoginFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(LoginFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(LoginFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(LoginFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new LoginFrame().setVisible(true); } }); }
From source file:math.tools.Browse.java
/** * @param args the command line arguments *//*from ww w . j a v a 2 s . co m*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Browse.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Browse.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Browse.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Browse.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Browse().setVisible(true); } }); }