Pablo Gallardo's Blog
My professional web log about IT, Project Management & SAP
 
Archive | Development RSS feed for this section

How to display an image on Java Swing

Images can be displayed in Java Swing using object JLabel. This is the partial code: JLabel label = new JLabel(); try { BufferedImage img = ImageIO.read(new File(IMG_FILES_PATH + IMG_FILENAME)); ImageIcon icon = new ImageIcon(img); label.setIcon(icon); } catch (IOException ex) { Logger.getLogger(SwingGUIMainScreen.class.getName()).log(Level.SEVERE, null, ex); } If I need the image to have an specific size, what […]

Comments { 0 }

How to scale an image in Java

I programmed my own function, based on other examples: /** * Method that scale an image (BufferedImage) into the specified dimensions * @param sbi Source image * @param imageType Image type among BufferedImage.TYPE_… constants (example: TYPE_INT_ARGB) * @param dWidth Image width, in pixels * @param dHeight Image height, in pixels * @return Destination image */ […]

Comments { 0 }

How to create JAR file for Java project

Ensure your project takes into account all considerations Follow the instructions on the link below: Java SE Deploy Build JAR file JAR file is built automatically from IDE like Eclipse or Apache NetBeans. Setting the icon for your JAR file You cannot change the default JAR icon of your application. Instead, you can generate an […]

Comments { 0 }

How to set dock icon of Java application

This solution is only available from JDK 9. In other to set the JDK version on NetBeans, right click on Project > “Properties” >> “Sources” > “Source/Binary format”; and “Libraries” > “Java Platform”. package main; import javax.swing.JFrame; import javax.swing.JLabel; import java.awt.Image; import java.awt.Taskbar; import java.awt.Toolkit; import java.net.URL; /** * author: flohall * date: 2019-07-07 */ […]

Comments { 0 }

Play sound clip from local file in Java

This solution works only for .wav files. Source code: public void playSound() { try { AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(“D:/MusicPlayer/fml.mp3″).getAbsoluteFile()); Clip clip = AudioSystem.getClip(); clip.open(audioInputStream); clip.start(); } catch(Exception ex) { System.out.println(“Error with playing sound.”); ex.printStackTrace(); } }   Source: “Playing .mp3 and .wav in Java?“, stackoverflow

Comments { 0 }

Install Android Studio in Mac

Android Studio is the official Google’s IDE to develop apps for Android, based on IntelliJ.   1. Download file Download latest Android Studio version for Mac (3.2.1 at the time of this article). 2. Install application Double-click on .dmg file and drag and drop Android Studio icon into Applications folder. 3. Run application Open Android […]

Comments { 0 }

Software Publisher Certificate Code Signing on Windows

https://docs.microsoft.com/es-es/windows-hardware/drivers/install/obtaining-a-software-publisher-certificate–spc-   https://www.thawte.com/code-signing/ https://blogs.msdn.microsoft.com/ieinternals/2011/03/22/everything-you-need-to-know-about-authenticode-code-signing/   https://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows   https://social.msdn.microsoft.com/Forums/en-US/a674d011-6d4d-43d0-9a3b-ea8143a44716/how-do-i-change-verified-publisher-unknown-to-verified-publisher-my-name-goes-here-in-the?forum=windowssecurity

Comments { 0 }

List of Prototyping and Mockup Apps

This is a non-exhaustive list of prototyping and mockups apps.   Balsamiq Commercial, 30-day trial version Web-based. https://balsamiq.com/   InVision https://www.invisionapp.com/home   Marvelapp Freemium. Web-based. https://marvelapp.com/   Moqups Freemium. Web-based. https://app.moqups.com   Pencil Project Open source, free. Desktop-based. There is a discontinued web-based version (Mozilla add-on). https://pencil.evolus.vn/   Sketch https://www.sketchapp.com/   Zeplin https://zeplin.io/  

Comments { 0 }
Política de privacidad