Posts

Showing posts from June, 2019

Add Comment Sample Project

Image
Hi everyone, Today I am going to develop simple " Add Comment " project. I use following code to show comment icon. IconButton comment = IconButton( iconSize: 35.0 , icon: Icon(Icons. chat_bubble_outline ,color: Colors. grey ), onPressed: ()=> _commentButtonPressed(), );   return ListTile( leading: comment, ) class CommentScreen extends StatefulWidget { final String postId ; const CommentScreen(document, this . postId ); @override _CommentScreenState createState() => _CommentScreenState( postId: this . postId , ); } class _CommentScreenState extends State<CommentScreen> { final String postId ; final TextEditingController _commentController = TextEditingController(); _CommentScreenState({ this . postId }); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text( "Comments" , style: TextStyle(color: Colors. black )

Like Button Sample Project

Image
Today I am going to build a Like button using flutter and fire-store. Actually this is not a button. It displays how to code for "Like Button" . Here I am using authenticate users and their user id. Here is the Sample Code for this project. class PublishPost extends StatefulWidget{    @override    _PublishPost createState() => new _PublishPost(); } class _PublishPost extends State<PublishPost> {   bool isPostLiked = false ;      @override      Widget _buildListItem (BuildContext context, DocumentSnapshot document) {       List<String> users;       Widget child;        if (document[ 'likedby' ].contains( '4' )) {         child = Text( 'Liked' );       } else {         child = Text( 'Like' );       }        return ListTile(         title: Row(           children: [             Expanded(               child: Text(                 document[ 'content' ],    

Simple Applet Project

Image
Code For The Project public class Assignment extends Applet implements Runnable  {         Image Picture;         public void init() {         Thread t = new Thread(this);         t.start();         Picture =  getImage(getDocumentBase(),"water.gif");     }         int i,j;         public void paint(Graphics g)         {                          resize(800,600);             drawPaint(i+20,200+j,g);             drawBoat(i+20,200+j,g);             drawBoat((-i)+800,200+j,g);             g.drawImage (Picture, 0, 300, this);             try {                 Thread.sleep(500);             } catch (InterruptedException ex) {                 Logger.getLogger(Assignment.class.getName()).log(Level.SEVERE, null, ex);             }                             }         public void drawBoat(int x,int y, Graphics g){              int z = x;               g.setColor(Color.gray);             int xpoint[] = {-20+z,200+z,80+

Web Cam Capture Program

Image
Hello everyone, in this post I am going to publish a web cam capture program using Java. 1.       First, you have to download OpenCV library using this link. ( https://opencv.org/releases/ ) 2.       Create a new NetBeans project and add OpenCV library. 3.       You can create your GUI now. 4.       This is the code for project import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.File; import javax.imageio.ImageIO; import javax.swing.JFileChooser; import java.io.ByteArrayInputStream; import javax.imageio.ImageIO; import javax.swing.JOptionPane; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.MatOfByte; import org.opencv.highgui.HighGui; import org.opencv.videoio.VideoCapture; import org.opencv.imgcodecs.Imgcodecs; public class Camera extends javax.swing.JFrame { private DaemonThread myThread = null; in