Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

MAIL / CATATAN</>
Mail31 Agt 2007

How do I send an email message?

To enable your application to send email you can use the JavaMail API, and prior to JDK 1.6 you will also need the JavaBeans Activation Framework. The JAF jar file should be included in your application classpath. package org.kodejava.mail; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.Properties; publi...

Wayan · 2 menit baca
SWING / CATATAN</>
Swing26 Agt 2007

How do I right justified JTextField contents?

To right justified a JTextField contents we can call the setHorizontalAlignment(JTextField.RIGHT) method of the JTextField class. package org.kodejava.swing; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; public class TextFieldRightJustify extends JFrame { public TextFieldRightJustify() { initComponents(); } public...

Wayan · 1 menit baca
SWING / CATATAN</>
Swing22 Agt 2007

How do I format JLabel using HTML?

JLabel text can be formatted using an HTML standard tags. The example below shows you how we can use and HTML font tag to change the font size, color and style of JLabel text. package org.kodejava.swing; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; import java.awt.Container; import java.awt.FlowLayout; public class JLabelHTMLStyle extends JFrame { public […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API21 Agt 2007

How do I get an exception stack trace message?

In this example we use the java.io.StringWriter and java.io.PrintWriter class to convert stack trace exception message to a string. package org.kodejava.io; import java.io.StringWriter; import java.io.PrintWriter; public class StackTraceToString { public static void main(String[] args) { try { int result = 10 / 0; } catch (Exception e) { // Create a StringWriter and a PrintWriter […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API21 Agt 2007

How do I read and write data in Windows registry?

The java.util.prefs package provides a way for applications to store and retrieve user and system preferences and data configuration. These preference data will be stored persistently in an implementation-dependent backing stored. For example in Windows operating system in will stored in Windows registry. To write and read these data we use the java.util.prefs.Preferences class. The […]

Wayan · 1 menit baca
SWING / CATATAN</>
Swing19 Agt 2007

How do I display an image in JButton?

package org.kodejava.swing; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; import java.awt.FlowLayout; public class ButtonImageExample extends JFrame { public ButtonImageExample() { initComponents(); } public static void main(String[] args) { SwingUtilities.invokeLater(() -> new ButtonImageExample().setVisible(true)); } private void initComponents() { setTitle("My Butt...

Wayan · 1 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.